Skip to content

Commit e0f8d1e

Browse files
authored
Merge pull request #1598 from certik/add_c
Allow Backend::c in the main driver
2 parents c96063b + 0c4e1bb commit e0f8d1e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bin/lpython.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ using LCompilers::endswith;
5050
using LCompilers::CompilerOptions;
5151
using LCompilers::LPython::parse_python_file;
5252

53-
enum Backend {
54-
llvm, cpp, x86, wasm, wasm_x86, wasm_x64
53+
enum class Backend {
54+
llvm, cpp, c, x86, wasm, wasm_x86, wasm_x64
5555
};
5656

5757
std::string remove_extension(const std::string& filename) {
@@ -1534,6 +1534,8 @@ int main(int argc, char *argv[])
15341534

15351535
if (arg_backend == "llvm") {
15361536
backend = Backend::llvm;
1537+
} else if (arg_backend == "c") {
1538+
backend = Backend::c;
15371539
} else if (arg_backend == "cpp") {
15381540
backend = Backend::cpp;
15391541
} else if (arg_backend == "x86") {
@@ -1545,7 +1547,7 @@ int main(int argc, char *argv[])
15451547
} else if (arg_backend == "wasm_x64") {
15461548
backend = Backend::wasm_x64;
15471549
} else {
1548-
std::cerr << "The backend must be one of: llvm, cpp, x86, wasm, wasm_x86, wasm_x64." << std::endl;
1550+
std::cerr << "The backend must be one of: llvm, c, cpp, x86, wasm, wasm_x86, wasm_x64." << std::endl;
15491551
return 1;
15501552
}
15511553

0 commit comments

Comments
 (0)