Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
yeti0904 committed Oct 24, 2024
1 parent 2db6ed4 commit 2bb24fa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/sierpinski.cal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include "cores/select.cal"

func sierpinski begin
func man sierpinski cell n begin
let cell n
let cell x
let cell y
Expand Down
15 changes: 10 additions & 5 deletions source/backends/arm64.d
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ class BackendARM64 : CompilerBackend {
if (!crt1) {
stderr.writeln("WARNING: Failed to find crt1.o, program may behave incorrectly");
}
} else if (os == "osx") {
}
else if (os == "osx") {
linkCommand ~= " -lSystem -syslibroot `xcrun --sdk macosx --show-sdk-path`";
} else {
}
else {
WarnNoInfo("Cannot use libc on operating system '%s'", os);
}
}
Expand Down Expand Up @@ -248,10 +250,12 @@ class BackendARM64 : CompilerBackend {
if (os == "osx") {
output ~= ".global _main\n";
output ~= "_main:\n";
} else if (useLibc) {
}
else if (useLibc) {
output ~= ".global main\n";
output ~= "main:\n";
} else {
}
else {
output ~= ".global _start\n";
output ~= "_start:\n";
}
Expand Down Expand Up @@ -1155,7 +1159,8 @@ class BackendARM64 : CompilerBackend {
if (offset >= 4096) {
output ~= format("mov x9, #%d\n", offset);
output ~= format("%s x20, x20, x9\n", sub ? "sub" : "add");
} else {
}
else {
output ~= format("%s x20, x20, #%d\n", sub ? "sub" : "add", offset);
}
}
Expand Down
12 changes: 8 additions & 4 deletions source/backends/x86_64.d
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,11 @@ class BackendX86_64 : CompilerBackend {
if (!crt1) {
stderr.writeln("WARNING: Failed to find crt1.o, program may behave incorrectly");
}
} else if (os == "osx") {
}
else if (os == "osx") {
linkCommand ~= " -syslibroot `xcrun --sdk macosx --show-sdk-path`";
} else {
}
else {
WarnNoInfo("Cannot use libc on operating system '%s'", os);
}
}
Expand Down Expand Up @@ -273,10 +275,12 @@ class BackendX86_64 : CompilerBackend {
output ~= "default rel\n";
output ~= "global _main\n";
output ~= "_main:\n";
} else if (useLibc) {
}
else if (useLibc) {
output ~= "global main\n";
output ~= "main:\n";
} else {
}
else {
output ~= "global _start\n";
output ~= "_start:\n";
}
Expand Down

0 comments on commit 2bb24fa

Please sign in to comment.