aboutsummaryrefslogtreecommitdiff
path: root/tools/exec_llvm.py
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-30 17:10:57 -0500
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-30 17:31:07 -0500
commitf10e3e811dee7522e737a93a3db53a5db1cf0b32 (patch)
tree12af4d758bf525aa63c4b2abac24ce141a23a855 /tools/exec_llvm.py
parentb6ebeed2cfcebb220f2ce700c7cbe484e62cd2e2 (diff)
Import shared.py properly
Diffstat (limited to 'tools/exec_llvm.py')
-rwxr-xr-xtools/exec_llvm.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/exec_llvm.py b/tools/exec_llvm.py
index 1b1bba1b..a2a000f0 100755
--- a/tools/exec_llvm.py
+++ b/tools/exec_llvm.py
@@ -36,10 +36,11 @@ the .ll into native code. This can be done as follows:
import os, sys
from subprocess import Popen, PIPE, STDOUT
-__rootpath__ = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+__rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def path_from_root(*pathelems):
return os.path.join(__rootpath__, *pathelems)
-exec(open(path_from_root('tools', 'shared.py'), 'r').read())
+sys.path += [path_from_root('')]
+from tools.shared import *
Popen([LLVM_OPT, sys.argv[1], '-strip-debug', '-o=' + sys.argv[1]+'.clean.bc']).communicate()[0]