[llvm-commits] [llvm] r92533 - in /llvm/trunk: lib/CodeGen/AsmPrinter/DwarfDebug.cpp test/FrontendC/2010-01-05-LinkageName.c
Chris Lattner
clattner at apple.com
Mon Jan 4 16:12:43 PST 2010
On Jan 4, 2010, at 3:04 PM, Devang Patel wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=92533&view=rev
> Log:
> Fix debug_inlined section entries for routines whose names are
> changed through __asm() extension.
Ok.
> StringPool.insert(InlinedSP.getName());
> - StringPool.insert(InlinedSP.getLinkageName());
> + StringRef LinkageName = InlinedSP.getLinkageName();
> + if (!LinkageName.empty()) {
> + // Skip special LLVM prefix that is used to inform the asm
> printer to not
> + // emit usual symbol prefix before the symbol name. This
> happens for
> + // Objective-C symbol names and symbol whose name is replaced
> using GCC's
> + // __asm__ attribute.
> + if (LinkageName[0] == 1)
> + LinkageName = LinkageName.substr(1);
How about:
if (LinkageName.startsWith('\1'))
LinkageName = LinkageName.substr(1);
?
-Chris
> + }
> + StringPool.insert(LinkageName);
> DILocation DL(Scope->getInlinedAt());
> addUInt(ScopeDIE, dwarf::DW_AT_call_file, 0, ModuleCU->getID());
> addUInt(ScopeDIE, dwarf::DW_AT_call_line, 0, DL.getLineNumber());
> @@ -2918,8 +2927,6 @@
> for (SmallVector<MDNode *, 4>::iterator I = InlinedSPNodes.begin(),
> E = InlinedSPNodes.end(); I != E; ++I) {
>
> -// for (ValueMap<MDNode *, SmallVector<InlineInfoLabels, 4>
> >::iterator
> - // I = InlineInfo.begin(), E = InlineInfo.end(); I != E;
> ++I) {
> MDNode *Node = *I;
> ValueMap<MDNode *, SmallVector<InlineInfoLabels, 4> >::iterator II
> = InlineInfo.find(Node);
> @@ -2937,13 +2944,11 @@
> // __asm__ attribute.
> if (LName[0] == 1)
> LName = LName.substr(1);
> -// Asm->EmitString(LName);
> EmitSectionOffset("string", "section_str",
> StringPool.idFor(LName), false, true);
>
> }
> Asm->EOL("MIPS linkage name");
> -// Asm->EmitString(Name);
> EmitSectionOffset("string", "section_str",
> StringPool.idFor(Name), false, true);
> Asm->EOL("Function name");
>
> Added: llvm/trunk/test/FrontendC/2010-01-05-LinkageName.c
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2010-01-05-LinkageName.c?rev=92533&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/test/FrontendC/2010-01-05-LinkageName.c (added)
> +++ llvm/trunk/test/FrontendC/2010-01-05-LinkageName.c Mon Jan 4
> 17:04:36 2010
> @@ -0,0 +1,15 @@
> +// RUN: %llvmgcc -O2 -S -g %s -o - | llc -o 2010-01-05-
> LinkageName.s -O0
> +// RUN: %compile_c 2010-01-05-LinkageName.s -o 2010-01-05-
> LinkageName.s
> +
> +struct tm {};
> +long mktime(struct tm *) __asm("_mktime$UNIX2003");
> +tzload(name, sp, doextend){}
> +long mktime(tmp)
> + struct tm *const tmp;
> +{
> + tzset();
> +}
> +timelocal(tmp) {
> + return mktime(tmp);
> +}
> +
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list