mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-26 19:36:28 +00:00
check-clang-tools: Prune 'clang' stuff. Clang is not used here.
llvm-svn: 196804
This commit is contained in:
parent
1ea38a2607
commit
21bf7a11b9
@ -24,7 +24,7 @@ endif()
|
||||
|
||||
set(CLANG_TOOLS_TEST_DEPS
|
||||
# Base line deps.
|
||||
clang clang-headers FileCheck count not
|
||||
FileCheck count not
|
||||
|
||||
# Individual tools we test.
|
||||
clang-apply-replacements
|
||||
|
@ -148,72 +148,13 @@ if config.test_exec_root is None:
|
||||
|
||||
###
|
||||
|
||||
# Discover the 'clang' and 'clangcc' to use.
|
||||
|
||||
import os
|
||||
|
||||
def inferClang(PATH):
|
||||
# Determine which clang to use.
|
||||
clang = os.getenv('CLANG')
|
||||
|
||||
# If the user set clang in the environment, definitely use that and don't
|
||||
# try to validate.
|
||||
if clang:
|
||||
return clang
|
||||
|
||||
# Otherwise look in the path.
|
||||
clang = lit.util.which('clang', PATH)
|
||||
|
||||
if not clang:
|
||||
lit_config.fatal("couldn't find 'clang' program, try setting "
|
||||
"CLANG in your environment")
|
||||
|
||||
return clang
|
||||
|
||||
# When running under valgrind, we mangle '-vg' onto the end of the triple so we
|
||||
# can check it with XFAIL and XTARGET.
|
||||
if lit_config.useValgrind:
|
||||
config.target_triple += '-vg'
|
||||
|
||||
config.clang = inferClang(config.environment['PATH']).replace('\\', '/')
|
||||
if not lit_config.quiet:
|
||||
lit_config.note('using clang: %r' % config.clang)
|
||||
|
||||
# Note that when substituting %clang_cc1 also fill in the include directory of
|
||||
# the builtin headers. Those are part of even a freestanding environment, but
|
||||
# Clang relies on the driver to locate them.
|
||||
def getClangBuiltinIncludeDir(clang):
|
||||
# FIXME: Rather than just getting the version, we should have clang print
|
||||
# out its resource dir here in an easy to scrape form.
|
||||
cmd = subprocess.Popen([clang, '-print-file-name=include'],
|
||||
stdout=subprocess.PIPE)
|
||||
if not cmd.stdout:
|
||||
lit_config.fatal("Couldn't find the include dir for Clang ('%s')" % clang)
|
||||
return cmd.stdout.read().strip()
|
||||
|
||||
config.substitutions.append( ('%clang_cc1', '%s -cc1 -internal-isystem %s'
|
||||
% (config.clang,
|
||||
getClangBuiltinIncludeDir(config.clang))) )
|
||||
|
||||
config.substitutions.append( ('%clangxx', ' ' + config.clang +
|
||||
' -ccc-clang-cxx -ccc-cxx '))
|
||||
config.substitutions.append( ('%clang', ' ' + config.clang + ' ') )
|
||||
|
||||
# FIXME: Find nicer way to prohibit this.
|
||||
config.substitutions.append(
|
||||
(' clang ', """*** Do not use 'clang' in tests, use '%clang'. ***""") )
|
||||
config.substitutions.append(
|
||||
(' clang\+\+ ', """*** Do not use 'clang++' in tests, use '%clangxx'. ***"""))
|
||||
config.substitutions.append(
|
||||
(' clang-cc ',
|
||||
"""*** Do not use 'clang-cc' in tests, use '%clang_cc1'. ***""") )
|
||||
config.substitutions.append(
|
||||
(' clang -cc1 ',
|
||||
"""*** Do not use 'clang -cc1' in tests, use '%clang_cc1'. ***""") )
|
||||
config.substitutions.append(
|
||||
(' %clang-cc1 ',
|
||||
"""*** invalid substitution, use '%clang_cc1'. ***""") )
|
||||
|
||||
###
|
||||
|
||||
# Set available features we allow tests to conditionalize on.
|
||||
|
Loading…
x
Reference in New Issue
Block a user