summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-01-20 16:14:18 +0000
committerEric Fiselier <eric@efcs.ca>2015-01-20 16:14:18 +0000
commit747c0fda5de57fb35518cb9b983ae5efe106c231 (patch)
tree3fef5171b6a6677da73636c8b82d6e3496408708 /libcxx
parente7a647886a9631e4873ec5bdffa8cadabd69c28d (diff)
downloadbcm5719-llvm-747c0fda5de57fb35518cb9b983ae5efe106c231.tar.gz
bcm5719-llvm-747c0fda5de57fb35518cb9b983ae5efe106c231.zip
Address danalbert's post-commit review comments on D7019 and small fixes.
This patch addresses some comments on http://reviews.llvm.org/D7019. - Move compiler.py to test/libcxx from test/libcxx/test. - Make CXXCompiler.target None by default. - Use `{}` instead of `dict()` to initialize an empty dict. - Pass the -fsanitize options to both the compile and link commands. llvm-svn: 226575
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/test/libcxx/compiler.py (renamed from libcxx/test/libcxx/test/compiler.py)4
-rw-r--r--libcxx/test/libcxx/test/config.py18
2 files changed, 12 insertions, 10 deletions
diff --git a/libcxx/test/libcxx/test/compiler.py b/libcxx/test/libcxx/compiler.py
index f991d9ee4eb..b47ecbd210d 100644
--- a/libcxx/test/libcxx/test/compiler.py
+++ b/libcxx/test/libcxx/compiler.py
@@ -10,7 +10,7 @@ class CXXCompiler(object):
self.link_flags = list(link_flags)
self.use_ccache = use_ccache
self.type = None
- self.version = (None, None, None)
+ self.version = None
self._initTypeAndVersion()
def _initTypeAndVersion(self):
@@ -99,7 +99,7 @@ class CXXCompiler(object):
cwd=cwd)
if rc != 0:
return None
- parsed_macros = dict()
+ parsed_macros = {}
lines = [l.strip() for l in out.split('\n') if l.strip()]
for l in lines:
assert l.startswith('#define ')
diff --git a/libcxx/test/libcxx/test/config.py b/libcxx/test/libcxx/test/config.py
index 0c782f15d52..e2b69e514c3 100644
--- a/libcxx/test/libcxx/test/config.py
+++ b/libcxx/test/libcxx/test/config.py
@@ -9,7 +9,7 @@ import lit.Test # pylint: disable=import-error,no-name-in-module
import lit.util # pylint: disable=import-error,no-name-in-module
from libcxx.test.format import LibcxxTestFormat
-from libcxx.test.compiler import CXXCompiler
+from libcxx.compiler import CXXCompiler
class Configuration(object):
@@ -95,8 +95,9 @@ class Configuration(object):
'(e.g., --param=cxx_under_test=clang++)')
self.cxx = CXXCompiler(cxx)
cxx_type = self.cxx.type
- maj_v, min_v, _ = self.cxx.version
if cxx_type is not None:
+ assert self.cxx.version is not None
+ maj_v, min_v, _ = self.cxx.version
self.config.available_features.add(cxx_type)
self.config.available_features.add('%s-%s.%s' % (
cxx_type, maj_v, min_v))
@@ -413,24 +414,25 @@ class Configuration(object):
if sys.platform.startswith('linux'):
self.cxx.link_flags += ['-ldl']
if san == 'Address':
- self.cxx.compile_flags += ['-fsanitize=address']
+ self.cxx.flags += ['-fsanitize=address']
if llvm_symbolizer is not None:
self.env['ASAN_SYMBOLIZER_PATH'] = llvm_symbolizer
self.config.available_features.add('asan')
elif san == 'Memory' or san == 'MemoryWithOrigins':
- self.cxx.compile_flags += ['-fsanitize=memory']
+ self.cxx.flags += ['-fsanitize=memory']
if san == 'MemoryWithOrigins':
self.cxx.compile_flags += ['-fsanitize-memory-track-origins']
if llvm_symbolizer is not None:
self.env['MSAN_SYMBOLIZER_PATH'] = llvm_symbolizer
self.config.available_features.add('msan')
elif san == 'Undefined':
- self.cxx.compile_flags += ['-fsanitize=undefined',
- '-fno-sanitize=vptr,function',
- '-fno-sanitize-recover', '-O3']
+ self.cxx.flags += ['-fsanitize=undefined',
+ '-fno-sanitize=vptr,function',
+ '-fno-sanitize-recover']
+ self.cxx.compile_flags += ['-O3']
self.config.available_features.add('ubsan')
elif san == 'Thread':
- self.cxx.compile_flags += ['-fsanitize=thread']
+ self.cxx.flags += ['-fsanitize=thread']
self.config.available_features.add('tsan')
else:
self.lit_config.fatal('unsupported value for '
OpenPOWER on IntegriCloud