@@ -184,7 +184,7 @@ def linkFiles(pArgs, fileNames):
184184
185185 fileNames = map (getBitcodePath , fileNames )
186186 linkCmd .extend ([x for x in fileNames if x != '' ])
187- _logger . info ( 'Writing output to %s' , pArgs . outputFile )
187+
188188 try :
189189 linkProc = Popen (linkCmd )
190190 except OSError as e :
@@ -261,8 +261,12 @@ def handleExecutable(pArgs):
261261 if not fileNames :
262262 return 1
263263
264+ if pArgs .sortBitcodeFilesFlag :
265+ fileNames = sorted (fileNames )
266+
267+
264268 if pArgs .manifestFlag :
265- writeManifest (pArgs , '{0}.llvm.manifest' .format (pArgs .inputFile ), fileNames )
269+ writeManifest ('{0}.llvm.manifest' .format (pArgs .inputFile ), fileNames )
266270
267271 if pArgs .outputFile is None :
268272 pArgs .outputFile = pArgs .inputFile + '.' + moduleExtension
@@ -279,13 +283,15 @@ def handleThinArchive(pArgs):
279283
280284 bcFiles = []
281285 for p in objectPaths :
282- _logger .info ('handleThinArchive: processing %s' , p )
286+ _logger .debug ('handleThinArchive: processing %s' , p )
283287 contents = pArgs .extractor (p )
284288 for c in contents :
285289 if c :
286- _logger .info ('\t including %s' , c )
290+ _logger .debug ('\t including %s' , c )
287291 bcFiles .append (str (c ))
288292
293+
294+
289295 return buildArchive (pArgs , bcFiles )
290296
291297#iam: do we want to preserve the order in the archive? if so we need to return both the list and the dict.
@@ -460,9 +466,12 @@ def buildArchive(pArgs, bitCodeFiles):
460466 else :
461467 _logger .info ('Generating LLVM Bitcode archive from an archive' )
462468
469+ if pArgs .sortBitcodeFilesFlag :
470+ bitCodeFiles = sorted (bitCodeFiles )
471+
463472 #write the manifest file if asked for
464473 if pArgs .manifestFlag :
465- writeManifest (pArgs , '{0}.llvm.manifest' .format (pArgs .inputFile ), bitCodeFiles )
474+ writeManifest ('{0}.llvm.manifest' .format (pArgs .inputFile ), bitCodeFiles )
466475
467476 if pArgs .bitcodeModuleFlag :
468477
@@ -492,9 +501,7 @@ def buildArchive(pArgs, bitCodeFiles):
492501 return archiveFiles (pArgs , bitCodeFiles )
493502
494503
495- def writeManifest (pArgs , manifestFile , bitCodeFiles ):
496- if pArgs .sortManifestFlag :
497- bitCodeFiles = sorted (bitCodeFiles )
504+ def writeManifest (manifestFile , bitCodeFiles ):
498505 with open (manifestFile , 'w' ) as output :
499506 for f in bitCodeFiles :
500507 output .write ('{0}\n ' .format (f ))
@@ -554,9 +561,9 @@ def extract_bc_args():
554561 dest = 'manifestFlag' ,
555562 help = 'Write a manifest file listing all the .bc files used.' ,
556563 action = 'store_true' )
557- parser .add_argument ('--sortmanifest ' , '-s' ,
558- dest = 'sortManifestFlag ' ,
559- help = 'Sort the manifest file (if written ).' ,
564+ parser .add_argument ('--sort ' , '-s' ,
565+ dest = 'sortBitcodeFilesFlag ' ,
566+ help = 'Sort the list of bitcode files (for debugging ).' ,
560567 action = 'store_true' )
561568 parser .add_argument ('--bitcode' , '-b' ,
562569 dest = 'bitcodeModuleFlag' ,
0 commit comments