aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-25 12:08:24 -0500
committerAlon Zakai <alonzakai@gmail.com>2013-02-25 12:08:24 -0500
commitdce4bc033cf7ae8ce4630991a7661446ecf5434e (patch)
tree3cd0a671a1234ab688fef5c0be000432fd4ab746 /tools
parentff41de227db521cf319bdc08901e5fa1e44c737d (diff)
remove llvm-nm/dis checks for bitcode in is_bitcode
Diffstat (limited to 'tools')
-rw-r--r--tools/shared.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/tools/shared.py b/tools/shared.py
index d40fe119..0dbdabe5 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1099,24 +1099,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e
@staticmethod
def is_bitcode(filename):
- # checks if a file contains LLVM bitcode
- # if the file doesn't exist or doesn't have valid symbols, it isn't bitcode
- try:
- defs = Building.llvm_nm(filename, stderr=PIPE)
- # If no symbols found, it might just be an empty bitcode file, try to dis it
- if len(defs.defs) + len(defs.undefs) + len(defs.commons) == 0:
- # llvm-nm 3.0 has a bug when reading symbols from ar files
- # so try to see if we're dealing with an ar file, in which
- # case we should try to dis it.
- if not Building.is_ar(filename):
- test_ll = os.path.join(EMSCRIPTEN_TEMP_DIR, 'test.ll')
- Building.llvm_dis(filename, test_ll)
- assert os.path.exists(test_ll)
- try_delete(test_ll)
- except Exception, e:
- if DEBUG: print >> sys.stderr, 'shared.Building.is_bitcode failed to test whether file \'%s\' is a llvm bitcode file! Failed on exception: %s' % (filename, e)
- return False
-
# look for magic signature
b = open(filename, 'r').read(4)
if b[0] == 'B' and b[1] == 'C':