Skip to content
Snippets Groups Projects
Commit 8f5dec99 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

hpvm-clang now sends -O flag the first

parent 6e961cf8
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ def compile_hpvm_c( ...@@ -30,7 +30,7 @@ def compile_hpvm_c(
include: List[PathLike] = None, include: List[PathLike] = None,
macro: List[str] = None, macro: List[str] = None,
flags: List[str] = None, flags: List[str] = None,
optim_level: str = "0", # -O0 optim_level: str = "1", # -O1
is_cpp: bool = True, # otherwise is C is_cpp: bool = True, # otherwise is C
std: str = None, # language std (-std=c++11) std: str = None, # language std (-std=c++11)
link_dirs: List[PathLike] = None, link_dirs: List[PathLike] = None,
...@@ -98,7 +98,7 @@ def hpvm_c_to_ll( ...@@ -98,7 +98,7 @@ def hpvm_c_to_ll(
extra_includes: List[PathLike] = None, extra_includes: List[PathLike] = None,
macros: List[str] = None, macros: List[str] = None,
flags: List[str] = None, flags: List[str] = None,
optim_level: str = "0", # -O0 optim_level: str = "1", # -O1
is_cpp: bool = True, # otherwise is C is_cpp: bool = True, # otherwise is C
std: str = None, # --std=c++11 std: str = None, # --std=c++11
) -> List[str]: ) -> List[str]:
...@@ -110,9 +110,9 @@ def hpvm_c_to_ll( ...@@ -110,9 +110,9 @@ def hpvm_c_to_ll(
flags.append(f"-std={std}") flags.append(f"-std={std}")
clang = "clang++" if is_cpp else "clang" clang = "clang++" if is_cpp else "clang"
return [ return [
str(LLVM_BUILD_BIN / clang), *includes_s, *flags, *macros, str(LLVM_BUILD_BIN / clang), f"-O{optim_level}",
f"-O{optim_level}", "-emit-llvm", "-S", *includes_s, *flags, *macros,
str(src_file), "-o", str(target_file) "-emit-llvm", "-S", str(src_file), "-o", str(target_file)
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment