mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Fix debug_inlined section entries for routines whose names are changed through __asm() extension.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92533 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1d44df6afe
commit
ba1d8264e6
@ -1393,7 +1393,16 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
|
|||||||
I->second.push_back(std::make_pair(StartID, ScopeDIE));
|
I->second.push_back(std::make_pair(StartID, ScopeDIE));
|
||||||
|
|
||||||
StringPool.insert(InlinedSP.getName());
|
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());
|
DILocation DL(Scope->getInlinedAt());
|
||||||
addUInt(ScopeDIE, dwarf::DW_AT_call_file, 0, ModuleCU->getID());
|
addUInt(ScopeDIE, dwarf::DW_AT_call_file, 0, ModuleCU->getID());
|
||||||
addUInt(ScopeDIE, dwarf::DW_AT_call_line, 0, DL.getLineNumber());
|
addUInt(ScopeDIE, dwarf::DW_AT_call_line, 0, DL.getLineNumber());
|
||||||
@ -2918,8 +2927,6 @@ void DwarfDebug::emitDebugInlineInfo() {
|
|||||||
for (SmallVector<MDNode *, 4>::iterator I = InlinedSPNodes.begin(),
|
for (SmallVector<MDNode *, 4>::iterator I = InlinedSPNodes.begin(),
|
||||||
E = InlinedSPNodes.end(); I != E; ++I) {
|
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;
|
MDNode *Node = *I;
|
||||||
ValueMap<MDNode *, SmallVector<InlineInfoLabels, 4> >::iterator II
|
ValueMap<MDNode *, SmallVector<InlineInfoLabels, 4> >::iterator II
|
||||||
= InlineInfo.find(Node);
|
= InlineInfo.find(Node);
|
||||||
@ -2937,13 +2944,11 @@ void DwarfDebug::emitDebugInlineInfo() {
|
|||||||
// __asm__ attribute.
|
// __asm__ attribute.
|
||||||
if (LName[0] == 1)
|
if (LName[0] == 1)
|
||||||
LName = LName.substr(1);
|
LName = LName.substr(1);
|
||||||
// Asm->EmitString(LName);
|
|
||||||
EmitSectionOffset("string", "section_str",
|
EmitSectionOffset("string", "section_str",
|
||||||
StringPool.idFor(LName), false, true);
|
StringPool.idFor(LName), false, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
Asm->EOL("MIPS linkage name");
|
Asm->EOL("MIPS linkage name");
|
||||||
// Asm->EmitString(Name);
|
|
||||||
EmitSectionOffset("string", "section_str",
|
EmitSectionOffset("string", "section_str",
|
||||||
StringPool.idFor(Name), false, true);
|
StringPool.idFor(Name), false, true);
|
||||||
Asm->EOL("Function name");
|
Asm->EOL("Function name");
|
||||||
|
15
test/FrontendC/2010-01-05-LinkageName.c
Normal file
15
test/FrontendC/2010-01-05-LinkageName.c
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user