Skip to content

Commit 9798437

Browse files
committed
use ARM64 backend by default on ARM hardware
1 parent a3f6665 commit 9798437

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

source/app.d

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import std.stdio;
66
import std.string;
77
import std.process;
88
import std.algorithm;
9+
import callisto.error;
910
import callisto.compiler;
1011
import callisto.language;
1112
import callisto.codeRemover;
@@ -75,7 +76,7 @@ int main(string[] args) {
7576
bool optimise;
7677
string[] versions;
7778
bool runFinal = true;
78-
CompilerBackend backend = new BackendX86_64();
79+
CompilerBackend backend;
7980
bool doDebug;
8081
bool debugParser;
8182
bool exportSymbols;
@@ -87,6 +88,17 @@ int main(string[] args) {
8788
bool assemblyLines;
8889
string os = "DEFAULT";
8990

91+
// choose default backend
92+
version (X86_64) {
93+
backend = new BackendX86_64();
94+
}
95+
else version (AArch64) {
96+
backend = new BackendARM64();
97+
}
98+
else {
99+
WarnNoInfo("No default backend for your system");
100+
}
101+
90102
for (size_t i = 1; i < args.length; ++ i) {
91103
if (args[i][0] == '-') {
92104
switch (args[i]) {
@@ -291,6 +303,10 @@ int main(string[] args) {
291303
}
292304
}
293305

306+
if (backend is null) {
307+
ErrorNoInfo("No backend selected");
308+
}
309+
294310
if (os == "DEFAULT") {
295311
os = backend.defaultOS;
296312
}

0 commit comments

Comments
 (0)