Merge pull request #175 from GuillaumeGomez/llvmint-update
Update llvmint
This commit is contained in:
commit
e6dbecdff3
1
.gitignore
vendored
1
.gitignore
vendored
@ -22,3 +22,4 @@ gcc_path
|
|||||||
benchmarks
|
benchmarks
|
||||||
tools/llvm-project
|
tools/llvm-project
|
||||||
tools/llvmint
|
tools/llvmint
|
||||||
|
tools/llvmint-2
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@ def run_command(command, cwd=None):
|
|||||||
def clone_repository(repo_name, path, repo_url, sub_path=None):
|
def clone_repository(repo_name, path, repo_url, sub_path=None):
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
while True:
|
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":
|
if choice == "" or choice.lower() == "n":
|
||||||
print("Skipping repository update.")
|
print("Skipping repository update.")
|
||||||
return
|
return
|
||||||
@ -116,7 +116,6 @@ def extract_instrinsics_from_llvmint(llvmint, intrinsics):
|
|||||||
]
|
]
|
||||||
|
|
||||||
json_file = os.path.join(llvmint, "target/doc/llvmint.json")
|
json_file = os.path.join(llvmint, "target/doc/llvmint.json")
|
||||||
if not os.path.exists(json_file):
|
|
||||||
# We need to regenerate the documentation!
|
# We need to regenerate the documentation!
|
||||||
run_command(
|
run_command(
|
||||||
["cargo", "rustdoc", "--", "-Zunstable-options", "--output-format", "json"],
|
["cargo", "rustdoc", "--", "-Zunstable-options", "--output-format", "json"],
|
||||||
@ -160,13 +159,14 @@ def fill_intrinsics(intrinsics, from_intrinsics, all_intrinsics):
|
|||||||
all_intrinsics[entry[0]] = entry[1]
|
all_intrinsics[entry[0]] = entry[1]
|
||||||
|
|
||||||
|
|
||||||
def update_intrinsics(llvm_path, llvmint):
|
def update_intrinsics(llvm_path, llvmint, llvmint2):
|
||||||
intrinsics_llvm = {}
|
intrinsics_llvm = {}
|
||||||
intrinsics_llvmint = {}
|
intrinsics_llvmint = {}
|
||||||
all_intrinsics = {}
|
all_intrinsics = {}
|
||||||
|
|
||||||
extract_instrinsics_from_llvm(llvm_path, intrinsics_llvm)
|
extract_instrinsics_from_llvm(llvm_path, intrinsics_llvm)
|
||||||
extract_instrinsics_from_llvmint(llvmint, intrinsics_llvmint)
|
extract_instrinsics_from_llvmint(llvmint, intrinsics_llvmint)
|
||||||
|
extract_instrinsics_from_llvmint(llvmint2, intrinsics_llvmint)
|
||||||
|
|
||||||
intrinsics = {}
|
intrinsics = {}
|
||||||
# We give priority to translations from LLVM over the ones from llvmint.
|
# We give priority to translations from LLVM over the ones from llvmint.
|
||||||
@ -209,6 +209,10 @@ def main():
|
|||||||
os.path.dirname(os.path.abspath(__file__)),
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
"llvmint",
|
"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.
|
# First, we clone the LLVM repository if it's not already here.
|
||||||
clone_repository(
|
clone_repository(
|
||||||
@ -222,7 +226,12 @@ def main():
|
|||||||
llvmint_path,
|
llvmint_path,
|
||||||
"https://github.com/GuillaumeGomez/llvmint",
|
"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__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user