[llvm-commits] [zorg] r115981 - /zorg/trunk/lnt/lnt/testing/util/compilers.py
Daniel Dunbar
daniel at zuster.org
Thu Oct 7 14:26:45 PDT 2010
Author: ddunbar
Date: Thu Oct 7 16:26:45 2010
New Revision: 115981
URL: http://llvm.org/viewvc/llvm-project?rev=115981&view=rev
Log:
lnt.testing.util.compilers: Avoid NamedTemporaryFile 'delete' kwarg, which was
new in 2.6, and update to accept Clang's new version format.
Modified:
zorg/trunk/lnt/lnt/testing/util/compilers.py
Modified: zorg/trunk/lnt/lnt/testing/util/compilers.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/testing/util/compilers.py?rev=115981&r1=115980&r2=115981&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/testing/util/compilers.py (original)
+++ zorg/trunk/lnt/lnt/testing/util/compilers.py Thu Oct 7 16:26:45 2010
@@ -57,7 +57,8 @@
cc_src_tag, = m.groups()
else:
error('unable to determine gcc build version: %r' % cc_build_string)
- elif (cc_name, cc_extra) in (('clang',''), ('Apple clang','')):
+ elif (cc_name in ('clang', 'Apple clang') and
+ cc_extra == '' or 'based on LLVM' in cc_extra):
llvm_capable = True
if cc_name == 'Apple clang':
cc_norm_name = 'apple_clang'
@@ -115,7 +116,10 @@
['-x', 'assembler', '/dev/null'],
include_stderr=True).strip()
- tf = tempfile.NamedTemporaryFile(suffix='.c', delete=False)
+ tf = tempfile.NamedTemporaryFile(suffix='.c')
+ name = tf.name
+ tf.close()
+ tf = open(name, 'w')
print >>tf, "int main() { return 0; }"
tf.close()
cc_ld_version = capture([cc, "-Wl,-v"] + cc_flags + [tf.name],
More information about the llvm-commits
mailing list