@@ -399,25 +399,24 @@ def getOutputFilename(self):
399
399
return '{0}.o' .format (root )
400
400
return 'a.out'
401
401
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
+
402
407
# iam: returns a pair [objectFilename, bitcodeFilename] i.e .o and .bc.
403
408
# the hidden flag determines whether the objectFile is hidden like the
404
409
# bitcodeFile is (starts with a '.'), use the logging level & DUMPING flag to get a sense
405
410
# of what is being written out.
406
411
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 )
412
416
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 ]
421
420
422
421
#iam: for printing our partitioning of the args
423
422
def dump (self ):
0 commit comments