[LLVMdev] llvmc for PIC16

Mikhail Glushenkov the.dead.shall.rise at gmail.com
Mon Jun 29 10:33:51 PDT 2009


Hi Sanjiv,

2009/6/29 Sanjiv Gupta <sanjiv.gupta at microchip.com>:
> Hi Mikhail,
>
> I want to retrieve the value of argv[0] (which was passed to main function
> of the driver) in PrependCustomizedPath.
> Do we have some standard name for argv[0] in tablegen?

This is not possible ATM, but is easy to add (assign argv to a global
variable Argv in main, then refer to Argv via an extern declaration in
PrependCustomizedPath; btw, the same mechanism can be used to refer to
command-line options).

On the other hand, you shouldn't have to condition on argv[0]. Look at
what the Base plugin does to choose the correct linker options (think
'gcc' versus 'g++'). By default, this information is deduced from the
input file names (if there are files ending with .cpp/.cxx/etc, we
choose the C++ linker), but the C++ linker can also be forced with the
-linker=c++ option. Then the analog of the 'g++' command can be
implemented as an alias to 'llvmc -linker=c++'. I prefer to do things
this way, that's why it's not possible to access argv[0] from
tablegen:-)

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments



More information about the llvm-dev mailing list