From bac878c9a334e60291f8c77cd02f24e35ac7b637 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 15 May 2022 15:13:48 +0200 Subject: [PATCH] Add instrinsics from aweinstock314's llvmint as well --- tools/generate_intrinsics.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/generate_intrinsics.py b/tools/generate_intrinsics.py index 4129c8cb447..849c6e9c981 100644 --- a/tools/generate_intrinsics.py +++ b/tools/generate_intrinsics.py @@ -16,7 +16,7 @@ def run_command(command, cwd=None): def clone_repository(repo_name, path, repo_url, sub_path=None): if os.path.exists(path): while True: - choice = input("There is already a `{}` folder, do you want to update it? [y/N]".format(repo_name)) + choice = input("There is already a `{}` folder, do you want to update it? [y/N]".format(path)) if choice == "" or choice.lower() == "n": print("Skipping repository update.") return @@ -159,13 +159,14 @@ def fill_intrinsics(intrinsics, from_intrinsics, all_intrinsics): all_intrinsics[entry[0]] = entry[1] -def update_intrinsics(llvm_path, llvmint): +def update_intrinsics(llvm_path, llvmint, llvmint2): intrinsics_llvm = {} intrinsics_llvmint = {} all_intrinsics = {} extract_instrinsics_from_llvm(llvm_path, intrinsics_llvm) extract_instrinsics_from_llvmint(llvmint, intrinsics_llvmint) + extract_instrinsics_from_llvmint(llvmint2, intrinsics_llvmint) intrinsics = {} # We give priority to translations from LLVM over the ones from llvmint. @@ -208,6 +209,10 @@ def main(): os.path.dirname(os.path.abspath(__file__)), "llvmint", ) + llvmint2_path = os.path.join( + os.path.dirname(os.path.abspath(__file__)), + "llvmint-2", + ) # First, we clone the LLVM repository if it's not already here. clone_repository( @@ -221,7 +226,12 @@ def main(): llvmint_path, "https://github.com/GuillaumeGomez/llvmint", ) - update_intrinsics(llvm_path, llvmint_path) + clone_repository( + "llvmint2", + llvmint2_path, + "https://github.com/antoyo/llvmint", + ) + update_intrinsics(llvm_path, llvmint_path, llvmint2_path) if __name__ == "__main__":