@@ -394,71 +394,6 @@ def handleArchive(pArgs):
394
394
395
395
396
396
397
- #iam: 5/1/2018 (soon to be given the flick from the codebase).
398
- def old_buggy_handleArchive (pArgs ):
399
-
400
- originalDir = os .getcwd () # This will be the destination
401
-
402
- pArgs .arCmd .append (pArgs .inputFile )
403
-
404
- # Make temporary directory to extract objects to
405
- tempDir = ''
406
- bitCodeFiles = []
407
-
408
- try :
409
- tempDir = tempfile .mkdtemp (suffix = 'wllvm' )
410
- os .chdir (tempDir )
411
-
412
- # Extract objects from archive
413
- try :
414
- arP = Popen (pArgs .arCmd )
415
- except OSError as e :
416
- if e .errno == 2 :
417
- errorMsg = 'Your ar does not seem to be easy to find.\n '
418
- else :
419
- errorMsg = 'OS error({0}): {1}' .format (e .errno , e .strerror )
420
- _logger .error (errorMsg )
421
- raise Exception (errorMsg )
422
-
423
- arPE = arP .wait ()
424
-
425
- if arPE != 0 :
426
- errorMsg = 'Failed to execute archiver with command {0}' .format (pArgs .arCmd )
427
- _logger .error (errorMsg )
428
- raise Exception (errorMsg )
429
-
430
- # Iterate over objects and examine their bitcode inserts
431
- for (root , _ , files ) in os .walk (tempDir ):
432
- _logger .debug ('Exploring "%s"' , root )
433
- for f in files :
434
- fPath = os .path .join (root , f )
435
- if FileType .getFileType (fPath ) == pArgs .fileType :
436
-
437
- # Extract bitcode locations from object
438
- contents = pArgs .extractor (fPath )
439
-
440
- for bcFile in contents :
441
- if bcFile != '' :
442
- bcFile = getBitcodePath (bcFile )
443
- if not os .path .exists (bcFile ):
444
- _logger .warning ('%s lists bitcode library "%s" but it could not be found' , f , bcFile )
445
- else :
446
- bitCodeFiles .append (bcFile )
447
- else :
448
- _logger .info ('Ignoring file "%s" in archive' , f )
449
-
450
- _logger .info ('Found the following bitcode file names to build bitcode archive:\n %s' , pprint .pformat (bitCodeFiles ))
451
-
452
- finally :
453
- # Delete the temporary folder
454
- _logger .debug ('Deleting temporary folder "%s"' , tempDir )
455
- shutil .rmtree (tempDir )
456
-
457
- # Build bitcode archive
458
- os .chdir (originalDir )
459
-
460
- return buildArchive (pArgs , bitCodeFiles )
461
-
462
397
def buildArchive (pArgs , bitCodeFiles ):
463
398
464
399
if pArgs .bitcodeModuleFlag :
0 commit comments