[llvm-branch-commits] [llvm-branch] r92546 - in /llvm/branches/Apple/Zoidberg: lib/CodeGen/AsmPrinter/DwarfDebug.cpp test/FrontendC/2010-01-05-LinkageName.c
Devang Patel
dpatel at apple.com
Mon Jan 4 16:00:43 PST 2010
Author: dpatel
Date: Mon Jan 4 18:00:43 2010
New Revision: 92546
URL: http://llvm.org/viewvc/llvm-project?rev=92546&view=rev
Log:
Merge r92533 from trunk.
Added:
llvm/branches/Apple/Zoidberg/test/FrontendC/2010-01-05-LinkageName.c
Modified:
llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=92546&r1=92545&r2=92546&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jan 4 18:00:43 2010
@@ -1451,7 +1451,16 @@
I->second.push_back(std::make_pair(StartID, ScopeDIE));
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);
+ }
+ 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());
@@ -2955,8 +2964,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);
SmallVector<InlineInfoLabels, 4> &Labels = II->second;
@@ -2973,13 +2980,11 @@
// __asm__ attribute.
if (LName[0] == 1)
LName = LName.data() + 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/branches/Apple/Zoidberg/test/FrontendC/2010-01-05-LinkageName.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/test/FrontendC/2010-01-05-LinkageName.c?rev=92546&view=auto
==============================================================================
--- llvm/branches/Apple/Zoidberg/test/FrontendC/2010-01-05-LinkageName.c (added)
+++ llvm/branches/Apple/Zoidberg/test/FrontendC/2010-01-05-LinkageName.c Mon Jan 4 18:00:43 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);
+}
+
More information about the llvm-branch-commits
mailing list