Revert "[LoongArch] Eliminate the redundant sign extension of division (#107971)"
[llvm-project.git] / lldb / scripts / use_lldb_suite.py
bloba050db0e79e6807d60536acbac1f6dd4e3a88a93
1 import inspect
2 import os
3 import sys
6 def find_lldb_root():
7 lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
8 while True:
9 parent = os.path.dirname(lldb_root)
10 if parent == lldb_root: # dirname('/') == '/'
11 raise Exception("use_lldb_suite_root.py not found")
12 lldb_root = parent
14 test_path = os.path.join(lldb_root, "use_lldb_suite_root.py")
15 if os.path.isfile(test_path):
16 return lldb_root
19 lldb_root = find_lldb_root()
21 import importlib.machinery
22 import importlib.util
24 path = os.path.join(lldb_root, "use_lldb_suite_root.py")
25 loader = importlib.machinery.SourceFileLoader("use_lldb_suite_root", path)
26 spec = importlib.util.spec_from_loader("use_lldb_suite_root", loader=loader)
27 module = importlib.util.module_from_spec(spec)
28 loader.exec_module(module)