mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Fix debug_inlined section entries for routines whose names are changed through __asm() extension.
llvm-svn: 92533
This commit is contained in:
parent
dc5355f563
commit
6915c52d56
@ -1393,7 +1393,16 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
|
||||
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());
|
||||
@ -2918,8 +2927,6 @@ void DwarfDebug::emitDebugInlineInfo() {
|
||||
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 @@ void DwarfDebug::emitDebugInlineInfo() {
|
||||
// __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");
|
||||
|
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…
x
Reference in New Issue
Block a user