[hmaptool] Turn %hmaptool into a proper substitution

This is still super ugly, but at least it doesn't require working
directories to just line up perfectly for python to find the tool.

llvm-svn: 335330
This commit is contained in:
Benjamin Kramer 2018-06-22 09:46:40 +00:00
parent 9c8f9374b5
commit 9b10b69afa
5 changed files with 9 additions and 5 deletions

View File

@ -3,7 +3,7 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t/m %t/i/Foo.framework/Headers
// RUN: echo '// Foo.h' > %t/i/Foo.framework/Headers/Foo.h
// RUN: '%python' hmaptool write %S/../Preprocessor/Inputs/headermap-rel/foo.hmap.json %t/i/foo.hmap
// RUN: %hmaptool write %S/../Preprocessor/Inputs/headermap-rel/foo.hmap.json %t/i/foo.hmap
// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
// RUN: %clang -fsyntax-only -fmodules -fmodules-cache-path=%t/m %s \

View File

@ -1,5 +1,5 @@
// RUN: rm -f %t.hmap
// RUN: '%python' hmaptool write %S/Inputs/headermap-rel/foo.hmap.json %t.hmap
// RUN: %hmaptool write %S/Inputs/headermap-rel/foo.hmap.json %t.hmap
// RUN: %clang_cc1 -E %s -o %t.i -I %t.hmap -F %S/Inputs/headermap-rel
// RUN: FileCheck %s -input-file %t.i

View File

@ -1,5 +1,5 @@
// RUN: rm -f %t.hmap
// RUN: '%python' hmaptool write %S/Inputs/headermap-rel2/project-headers.hmap.json %t.hmap
// RUN: %hmaptool write %S/Inputs/headermap-rel2/project-headers.hmap.json %t.hmap
// RUN: %clang_cc1 -v -fsyntax-only %s -iquote %t.hmap -isystem %S/Inputs/headermap-rel2/system/usr/include -I %S/Inputs/headermap-rel2 -H
// RUN: %clang_cc1 -fsyntax-only %s -iquote %t.hmap -isystem %S/Inputs/headermap-rel2/system/usr/include -I %S/Inputs/headermap-rel2 -H 2> %t.out
// RUN: FileCheck %s -input-file %t.out

View File

@ -1,5 +1,5 @@
// RUN: rm -f %t.hmap
// RUN: '%python' hmaptool write %S/Inputs/nonportable-hmaps/foo.hmap.json %t.hmap
// RUN: %hmaptool write %S/Inputs/nonportable-hmaps/foo.hmap.json %t.hmap
// RUN: %clang_cc1 -Eonly \
// RUN: -I%t.hmap \
// RUN: -I%S/Inputs/nonportable-hmaps \

View File

@ -58,7 +58,7 @@ tool_dirs = [config.clang_tools_dir, config.llvm_tools_dir]
tools = [
'c-index-test', 'clang-check', 'clang-diff', 'clang-format', 'clang-tblgen',
'opt', 'hmaptool',
'opt',
ToolSubst('%clang_func_map', command=FindTool(
'clang-func-mapping'), unresolved='ignore'),
]
@ -69,6 +69,10 @@ if config.clang_examples:
llvm_config.add_tool_substitutions(tools, tool_dirs)
config.substitutions.append(
('%hmaptool', '%s %s' % (config.python_executable,
os.path.join(config.llvm_tools_dir, 'hmaptool'))))
# Plugins (loadable modules)
# TODO: This should be supplied by Makefile or autoconf.
if sys.platform in ['win32', 'cygwin']: