Skip to content

Commit 51174ab

Browse files
committed
2 parents c2014e7 + 55682a6 commit 51174ab

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

wllvm/arglistfilter.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -399,25 +399,24 @@ def getOutputFilename(self):
399399
return '{0}.o'.format(root)
400400
return 'a.out'
401401

402+
def getBitcodeFileName(self):
403+
(dirs, baseFile) = os.path.split(self.getOutputFilename())
404+
bcfilename = os.path.join(dirs, '.{0}.bc'.format(baseFile))
405+
return bcfilename
406+
402407
# iam: returns a pair [objectFilename, bitcodeFilename] i.e .o and .bc.
403408
# the hidden flag determines whether the objectFile is hidden like the
404409
# bitcodeFile is (starts with a '.'), use the logging level & DUMPING flag to get a sense
405410
# of what is being written out.
406411
def getArtifactNames(self, srcFile, hidden=False):
407-
if self.outputFilename is not None:
408-
objFile = self.outputFilename
409-
(dirs, baseFile) = os.path.split(objFile)
410-
bcFile = os.path.join(dirs, '.{0}.bc'.format(baseFile))
411-
return [objFile, bcFile]
412+
(_, srcbase) = os.path.split(srcFile)
413+
(srcroot, _) = os.path.splitext(srcbase)
414+
if hidden:
415+
objbase = '.{0}.o'.format(srcroot)
412416
else:
413-
(_, srcbase) = os.path.split(srcFile)
414-
(srcroot, _) = os.path.splitext(srcbase)
415-
if hidden:
416-
objbase = '.{0}.o'.format(srcroot)
417-
else:
418-
objbase = '{0}.o'.format(srcroot)
419-
bcbase = '.{0}.o.bc'.format(srcroot)
420-
return [objbase, bcbase]
417+
objbase = '{0}.o'.format(srcroot)
418+
bcbase = '.{0}.o.bc'.format(srcroot)
419+
return [objbase, bcbase]
421420

422421
#iam: for printing our partitioning of the args
423422
def dump(self):

wllvm/compilers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ def buildAndAttachBitcode(builder):
246246
# maybe python-magic is in our future ...
247247
srcFile = af.inputFiles[0]
248248
(objFile, bcFile) = af.getArtifactNames(srcFile, hidden)
249+
if af.outputFilename is not None:
250+
objFile = af.outputFilename
251+
bcFile = af.getBitcodeFileName()
249252
buildBitcodeFile(builder, srcFile, bcFile)
250253
attachBitcodePathToObject(bcFile, objFile)
251254

wllvm/version.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
5151
1.1.0 - 4/21/2017 no new features on the horizon, no new bugs?
5252
53+
1.1.1 - 4/25/2017 bugs introduced by the new fetures have hopefully been eradicated.
54+
5355
5456
"""
5557

56-
wllvm_version = '1.1.0'
58+
wllvm_version = '1.1.1'

0 commit comments

Comments
 (0)