Skip to content

Commit d978854

Browse files
committed
linting in preparation for publishing.
1 parent b048183 commit d978854

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

test/test_files/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ link_with_archive:: archive
6161
$(CC) main.o libfoo.a -o main.arch
6262

6363
clean:
64-
rm -f *.o main main.arch .*.o.bc .*.o *.bc .*.bc a.out *.s *.i hello *.a *.bca *.dylib *.manifest
64+
rm -f *.o main main.arch .*.o.bc .*.o *.bc .*.bc a.out *.s *.i hello *.a *.bca *.dylib *.manifest *.ll
6565

6666
mystery:
6767
otool -X -s __WLLVM __llvm_bc main > main.otool

wllvm/extraction.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -338,15 +338,14 @@ def extractFile(archive, filename, instance):
338338

339339

340340
def handleArchiveDarwin(pArgs):
341-
342341
originalDir = os.getcwd() # This will be the destination
343342

344343
pArgs.arCmd.append(pArgs.inputFile)
345344

346345
# Make temporary directory to extract objects to
347346
tempDir = ''
348-
bitCodeFiles = [ ]
349-
retCode=0
347+
bitCodeFiles = []
348+
350349
try:
351350

352351

@@ -374,30 +373,29 @@ def handleArchiveDarwin(pArgs):
374373
_logger.debug(2)
375374

376375
# Iterate over objects and examine their bitcode inserts
377-
for (root, dirs, files) in os.walk(tempDir):
378-
_logger.debug('Exploring "{0}"'.format(root))
379-
for f in files:
380-
fPath = os.path.join(root, f)
381-
if FileType.getFileType(fPath) == pArgs.fileType:
382-
383-
# Extract bitcode locations from object
384-
contents = pArgs.extractor(fPath)
385-
386-
for bcFile in contents:
387-
if bcFile != '':
388-
if not os.path.exists(bcFile):
389-
_logger.warning('{0} lists bitcode library "{1}" but it could not be found'.format(f, bcFile))
390-
else:
391-
bitCodeFiles.append(bcFile)
392-
else:
393-
_logger.info('Ignoring file "{0}" in archive'.format(f))
394-
395-
_logger.info('Found the following bitcode file names to build bitcode archive:\n{0}'.format(
396-
pprint.pformat(bitCodeFiles)))
376+
for (root, _, files) in os.walk(tempDir):
377+
_logger.debug('Exploring "%s"', root)
378+
for f in files:
379+
fPath = os.path.join(root, f)
380+
if FileType.getFileType(fPath) == pArgs.fileType:
381+
382+
# Extract bitcode locations from object
383+
contents = pArgs.extractor(fPath)
384+
385+
for bcFile in contents:
386+
if bcFile != '':
387+
if not os.path.exists(bcFile):
388+
_logger.warning('%s lists bitcode library "%s" but it could not be found', f, bcFile)
389+
else:
390+
bitCodeFiles.append(bcFile)
391+
else:
392+
_logger.info('Ignoring file "%s" in archive', f)
393+
394+
_logger.info('Found the following bitcode file names to build bitcode archive:\n%s', pprint.pformat(bitCodeFiles))
397395

398396
finally:
399397
# Delete the temporary folder
400-
_logger.debug('Deleting temporary folder "{0}"'.format(tempDir))
398+
_logger.debug('Deleting temporary folder "%s"', tempDir)
401399
shutil.rmtree(tempDir)
402400

403401
#write the manifest file if asked for

0 commit comments

Comments
 (0)