From e25b845b437cdee395d22c9e2f292fc2dec9521d Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Tue, 30 Jun 2009 00:16:43 +0000 Subject: [PATCH] Regenerate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74485 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CompilerDriver.html | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) 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'. -->
  • Hooks and environment variables
  • How plugins are loaded
  • Debugging
  • +
  • Conditioning on the executable name
  • @@ -94,9 +95,8 @@ $ llvmc --linker=c++ hello.o $ ./a.out hello -

    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.

    Predefined options

    @@ -633,6 +633,27 @@ be performed at compile-time because the plugins can load code dynamically. When invoked with --check-graph, llvmc doesn't perform any compilation tasks and returns the number of encountered errors as its status code.

    +
    +
    +

    Conditioning on the executable name

    +

    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).


    -- 2.34.1