diff --git a/docs/CompilerDriver.html b/docs/CompilerDriver.html index d0bb72396c4..d84aacf14bb 100644 --- a/docs/CompilerDriver.html +++ b/docs/CompilerDriver.html @@ -37,6 +37,7 @@ The ReST source lives in the directory 'tools/llvmc/doc'. -->
By default, LLVMC uses llvm-gcc to compile the source code. It is -also possible to choose the work-in-progress clang compiler with -the -clang option.
+By default, LLVMC uses llvm-gcc to compile the source code. It is also +possible to choose the clang compiler with the -clang option.
For now, the executable name (the value passed to the driver in argv[0]) is +accessible only in the C++ code (i.e. hooks). Use the following code:
++namespace llvmc { +extern const char* ProgramName; +} + +std::string MyHook() { +//... +if (strcmp(ProgramName, "mydriver") == 0) { + //... + +} ++
In general, you're encouraged not to make the behaviour dependent on the +executable file name, and use command-line switches instead. See for example how +the Base plugin behaves when it needs to choose the correct linker options +(think g++ vs. gcc).