[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
diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 6fa7ef6..5b11691 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -58,7 +58,7 @@
 
 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 @@
 
 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']: