[llvm-commits] [llvm] r76117 - in /llvm/trunk: lib/CodeGen/AsmPrinter/AsmPrinter.cpp test/FrontendC++/2009-07-15-LineNumbers.cpp

Chris Lattner clattner at apple.com
Fri Jul 17 14:15:39 PDT 2009


On Jul 17, 2009, at 11:49 AM, David Greene wrote:

> On Friday 17 July 2009 11:24, Chris Lattner wrote:
>
>> Please only emit comments if the "-asm-verbose" LLC flag is set.
>
> Hrm...How do I do that in a file that could be linked with many  
> different
> executables?  Do I add an option in AsmPrinter.cpp and have LLC set it
> if -asm-verbose is set, or any other tool set it as they see fit?
>
> I'm fine making the change, I'd just like some guidance as how to make
> it the least ugly thing possible.  :)

Please make it be a bool in TargetOptions.h

>> Also, have you considered adding the filename (without leading path)
>> to the generated comments?  It would be nice to see something like:
>>
>>   foo     # Loc: x.c:2:42
>
> I considered the filename but thought it would be redundant with the
> asm file name.  Isn't <file>.bc generated as <file>.s?  Yes, users
> can override that, but then don't they know where the asm came from?
> Adding the filename seems like useless clutter.

When you turn on optimizations (and even when you don't) often you get  
inline functions from header files interspersed into your .o file.   
Thus you could have vector:42, unidstd.h:...

>
>> Also, the column # should only print if non-zero.
>
> I thought about that too.  I'll make the change.

Thanks!

-Chris



More information about the llvm-commits mailing list