Skip to content

Commit bac878c

Browse files
Add instrinsics from aweinstock314's llvmint as well
1 parent e25e2c3 commit bac878c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tools/generate_intrinsics.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def run_command(command, cwd=None):
1616
def clone_repository(repo_name, path, repo_url, sub_path=None):
1717
if os.path.exists(path):
1818
while True:
19-
choice = input("There is already a `{}` folder, do you want to update it? [y/N]".format(repo_name))
19+
choice = input("There is already a `{}` folder, do you want to update it? [y/N]".format(path))
2020
if choice == "" or choice.lower() == "n":
2121
print("Skipping repository update.")
2222
return
@@ -159,13 +159,14 @@ def fill_intrinsics(intrinsics, from_intrinsics, all_intrinsics):
159159
all_intrinsics[entry[0]] = entry[1]
160160

161161

162-
def update_intrinsics(llvm_path, llvmint):
162+
def update_intrinsics(llvm_path, llvmint, llvmint2):
163163
intrinsics_llvm = {}
164164
intrinsics_llvmint = {}
165165
all_intrinsics = {}
166166

167167
extract_instrinsics_from_llvm(llvm_path, intrinsics_llvm)
168168
extract_instrinsics_from_llvmint(llvmint, intrinsics_llvmint)
169+
extract_instrinsics_from_llvmint(llvmint2, intrinsics_llvmint)
169170

170171
intrinsics = {}
171172
# We give priority to translations from LLVM over the ones from llvmint.
@@ -208,6 +209,10 @@ def main():
208209
os.path.dirname(os.path.abspath(__file__)),
209210
"llvmint",
210211
)
212+
llvmint2_path = os.path.join(
213+
os.path.dirname(os.path.abspath(__file__)),
214+
"llvmint-2",
215+
)
211216

212217
# First, we clone the LLVM repository if it's not already here.
213218
clone_repository(
@@ -221,7 +226,12 @@ def main():
221226
llvmint_path,
222227
"https://github.com/GuillaumeGomez/llvmint",
223228
)
224-
update_intrinsics(llvm_path, llvmint_path)
229+
clone_repository(
230+
"llvmint2",
231+
llvmint2_path,
232+
"https://github.com/antoyo/llvmint",
233+
)
234+
update_intrinsics(llvm_path, llvmint_path, llvmint2_path)
225235

226236

227237
if __name__ == "__main__":

0 commit comments

Comments
 (0)