[IRBuilder] Refactor FMF interface (#121657)
[llvm-project.git] / .github / workflows / ci-post-commit-analyzer-run.py
blobe5f52d3b2fa6719ac741866dd1a7f678189e94a5
1 import json
2 import multiprocessing
3 import os
4 import re
5 import subprocess
6 import sys
9 def run_analyzer(data):
10 os.chdir(data["directory"])
11 command = (
12 data["command"]
13 + f" --analyze --analyzer-output html -o analyzer-results -Xclang -analyzer-config -Xclang max-nodes=75000"
15 print(command)
16 subprocess.run(command, shell=True, check=True)
19 def pool_error(e):
20 print("Error analyzing file:", e)
23 def main():
24 db_path = sys.argv[1]
25 database = json.load(open(db_path))
27 with multiprocessing.Pool() as pool:
28 pool.map_async(run_analyzer, [k for k in database], error_callback=pool_error)
29 pool.close()
30 pool.join()
33 if __name__ == "__main__":
34 main()