[llvm-commits] [llvm] r75515 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Devang Patel
devang.patel at gmail.com
Mon Jul 13 15:13:29 PDT 2009
On Mon, Jul 13, 2009 at 2:56 PM, Chris Lattner<clattner at apple.com> wrote:
> On Jul 13, 2009, at 2:48 PM, Devang Patel wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=75515&view=rev
>> Log:
>> Use AsmPrinter's Mangler to remove leading '1' from linkage names.
>
> Thanks Devang, this should work.
>
>>
>> + /// getMangler - Return Mangler used by the AsmPrinter. This is
>> used by
>> + /// DWARF debug info generator.
>
> No need to say who uses this. This will just get out of date.
>
>> @@ -785,9 +786,11 @@
>> AddString(GVDie, dwarf::DW_AT_name, dwarf::DW_FORM_string, Name);
>> std::string LinkageName;
>> GV.getLinkageName(LinkageName);
>> - if (!LinkageName.empty())
>> + if (!LinkageName.empty()) {
>> + Mangler *Mg = Asm->getMangler();
>> AddString(GVDie, dwarf::DW_AT_MIPS_linkage_name,
>> dwarf::DW_FORM_string,
>> - LinkageName);
>> + Mg ? Mg->makeNameProper(LinkageName) : LinkageName);
>
> Can the mangler ever be null? If not, please remove the two checks.
Just being paranoid. Right now, DwarfWriter and AsmPrinter are
separate passes and Mangler is initialized dring
AsmPrinter->doInitialization().
-
Devang
More information about the llvm-commits
mailing list