]> granicus.if.org Git - clang/commitdiff
[hmaptool] Turn %hmaptool into a proper substitution
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 22 Jun 2018 09:46:40 +0000 (09:46 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 22 Jun 2018 09:46:40 +0000 (09:46 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335330 91177308-0d34-0410-b5e6-96231b3b80d8

test/Modules/crash-vfs-headermaps.m
test/Preprocessor/headermap-rel.c
test/Preprocessor/headermap-rel2.c
test/Preprocessor/nonportable-include-with-hmap.c
test/lit.cfg.py

index c340d268ea96f2d22e13c7ce697023104a3092fc..118537ba2a4fd5c671113c45826531736567216c 100644 (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 \
index 4c67186830fbf2003b485fc5464c54865312233e..db57534c1c7fbb230bbdadc920fb237a9a04352a 100644 (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
 
index af12bf3949bc32140c8d570c09ad0fddc6b2db1d..83e89f0a492eb2655863d668eb5217c199654903 100644 (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
index f2c279f36ceb789a6b0d7932063a9c714a70f654..bbbd669a0f39f510f39b54c5f1fc2352b74824a7 100644 (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          \
index 6fa7ef66fc9005d4e36654c24ba05d3b392f8880..5b11691f4475842ef9cd0353ede2539d004d4255 100644 (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']: