@@ -12,7 +12,7 @@ def run_command(command, cwd=None):
12
12
sys .exit (1 )
13
13
14
14
15
- def clone_repository (repo_name , path , repo_url , sub_paths , commit ):
15
+ def clone_repository (repo_name , path , repo_url , sub_paths ):
16
16
if os .path .exists (path ):
17
17
while True :
18
18
choice = input ("There is already a `{}` folder, do you want to update it? [y/N]" .format (path ))
@@ -21,18 +21,16 @@ def clone_repository(repo_name, path, repo_url, sub_paths, commit):
21
21
return
22
22
elif choice .lower () == "y" :
23
23
print ("Updating repository..." )
24
- run_command (["git" , "pull " , "origin" ], cwd = path )
24
+ run_command (["git" , "fetch " , "origin" ], cwd = path )
25
25
run_command (["git" , "checkout" , "origin/main" ,], cwd = path )
26
- run_command (["git" , "checkout" , commit ], cwd = path )
27
26
return
28
27
else :
29
28
print ("Didn't understand answer..." )
30
29
print ("Cloning {} repository..." .format (repo_name ))
31
30
run_command (["git" , "clone" , repo_url , "--filter=tree:0" , "--no-checkout" , path ])
32
31
run_command (["git" , "sparse-checkout" , "init" ], cwd = path )
33
32
run_command (["git" , "sparse-checkout" , "set" , * sub_paths ], cwd = path )
34
- # run_command(["git", "checkout", "origin/main",], cwd=path)
35
- run_command (["git" , "checkout" , commit ], cwd = path )
33
+ run_command (["git" , "checkout" , "origin/main" ,], cwd = path )
36
34
37
35
38
36
def append_intrinsic (array , intrinsic_name , translation ):
@@ -112,11 +110,15 @@ def main():
112
110
llvm_path ,
113
111
"https://github.com/llvm/llvm-project" ,
114
112
["llvm/include/llvm/IR" , "llvm/include/llvm/CodeGen/" ],
115
- # This is the git submodule commit of the LLVM repository used in the Rust repository.
116
- "1268e87bdbaed0693a9d782ccd5a21e2cab2de33" ,
117
113
)
118
114
update_intrinsics (llvm_path )
119
115
116
+ # llvm-tblgen can be built with:
117
+ #
118
+ # mkdir llvm-tblgen-build && cd llvm-tblgen-build
119
+ # cmake -G Ninja -DLLVM_ENABLE_PROJECTS="llvm" -DCMAKE_BUILD_TYPE=Release ../llvm
120
+ # ninja llvm-tblgen
121
+
120
122
121
123
if __name__ == "__main__" :
122
124
sys .exit (main ())
0 commit comments