Skip to content

Commit 4ed6a5b

Browse files
author
Dan Liew
committed
Added some helpful logging to "as"
1 parent e90e496 commit 4ed6a5b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

driver/as

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ argFilter = BCFilter(sys.argv[1:])
3232
try:
3333
[infile] = argFilter.inputFiles
3434
except ValueError:
35+
logging.debug('Input file argument not detected, assuming stdin.')
3536
infile = "-"
3637

3738
# set llvm-as
@@ -41,14 +42,20 @@ if os.getenv(llvmCompilerPathEnv):
4142

4243
# Now compile this llvm assembly file into a bitcode file. The output
4344
# filename is the same as the object with a .bc appended
44-
(dirs, filename) = os.path.split(argFilter.outFileName)
45+
try:
46+
(dirs, filename) = os.path.split(argFilter.outFileName)
47+
except AttributeError as e:
48+
logging.error('Output file argument not found.\nException message: ' + str(e))
49+
sys.exit(1)
50+
4551
bcfilename = '.{0}.bc'.format(filename)
4652
bcPath = os.path.join(dirs, bcfilename)
4753
fakeAssembler = [llvmAssembler, infile, '-o', bcPath]
4854
asmProc = Popen(fakeAssembler)
4955
realRet = asmProc.wait()
5056

5157
if realRet != 0:
58+
logging.error('llvm-as failed')
5259
sys.exit(realRet)
5360

5461
attachBitcodePathToObject(bcPath, argFilter.outFileName)

0 commit comments

Comments
 (0)