Skip to content

Commit e90e496

Browse files
author
Dan Liew
committed
Enabled popenwrapper and logging in driver/as
The LLVM_COMPILER_PATH environment variable is now used for running llvm-as
1 parent 0a2c027 commit e90e496

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

driver/as

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import sys
1515
from utils import *
1616
from subprocess import *
1717
from popenwrapper import Popen
18+
import logconfig
1819

1920

2021
class BCFilter(ArgumentListFilter):
@@ -33,13 +34,18 @@ try:
3334
except ValueError:
3435
infile = "-"
3536

37+
# set llvm-as
38+
llvmAssembler='llvm-as'
39+
if os.getenv(llvmCompilerPathEnv):
40+
llvmAssembler = os.path.join(os.getenv(llvmCompilerPathEnv), llvmAssembler)
41+
3642
# Now compile this llvm assembly file into a bitcode file. The output
3743
# filename is the same as the object with a .bc appended
3844
(dirs, filename) = os.path.split(argFilter.outFileName)
3945
bcfilename = '.{0}.bc'.format(filename)
4046
bcPath = os.path.join(dirs, bcfilename)
41-
fakeAssembler = ['llvm-as', infile, '-o', bcPath]
42-
asmProc = subprocess.Popen(fakeAssembler)
47+
fakeAssembler = [llvmAssembler, infile, '-o', bcPath]
48+
asmProc = Popen(fakeAssembler)
4349
realRet = asmProc.wait()
4450

4551
if realRet != 0:

0 commit comments

Comments
 (0)