aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-01-21 13:04:00 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-01-21 13:04:00 +0000
commita298bb752572f03f3b65260a73cb39df02770075 (patch)
tree56cdc9db6881f9d41a239ad6d7d79b79d42f6f4d /tools
parent8f7c2e67693faa76065749652ed027b32e8212b2 (diff)
downloadexternal_llvm-a298bb752572f03f3b65260a73cb39df02770075.zip
external_llvm-a298bb752572f03f3b65260a73cb39df02770075.tar.gz
external_llvm-a298bb752572f03f3b65260a73cb39df02770075.tar.bz2
Allow hooks with arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62685 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvmc/doc/LLVMC-Reference.rst19
1 files changed, 12 insertions, 7 deletions
diff --git a/tools/llvmc/doc/LLVMC-Reference.rst b/tools/llvmc/doc/LLVMC-Reference.rst
index d70b4a5..9eb927c 100644
--- a/tools/llvmc/doc/LLVMC-Reference.rst
+++ b/tools/llvmc/doc/LLVMC-Reference.rst
@@ -560,16 +560,21 @@ Hooks and environment variables
-------------------------------
Normally, LLVMC executes programs from the system ``PATH``. Sometimes,
-this is not sufficient: for example, we may want to specify tool names
-in the configuration file. This can be achieved via the mechanism of
-hooks - to write your own hooks, just add their definitions to the
-``PluginMain.cpp`` or drop a ``.cpp`` file into the
-``$LLVMC_DIR/driver`` directory. Hooks should live in the ``hooks``
-namespace and have the signature ``std::string hooks::MyHookName
-(void)``. They can be used from the ``cmd_line`` tool property::
+this is not sufficient: for example, we may want to specify tool paths
+or names in the configuration file. This can be easily achieved via
+the hooks mechanism. To write your own hooks, just add their
+definitions to the ``PluginMain.cpp`` or drop a ``.cpp`` file into the
+your plugin directory. Hooks should live in the ``hooks`` namespace
+and have the signature ``const char* hooks::MyHookName ([const char*
+Arg0 [ const char* Arg2 [, ...]]])``. They can be used from the
+``cmd_line`` tool property::
(cmd_line "$CALL(MyHook)/path/to/file -o $CALL(AnotherHook)")
+To pass arguments to hooks, use the following syntax::
+
+ (cmd_line "$CALL(MyHook, 'Arg1', 'Arg2', 'Arg # 3')/path/to/file -o1 -o2")
+
It is also possible to use environment variables in the same manner::
(cmd_line "$ENV(VAR1)/path/to/file -o $ENV(VAR2)")