Skip to content

Commit 96678f3

Browse files
[clang][DebugInfo] Add virtual call-site target information in DWARF.
Fix clang-format issues.
1 parent 1899490 commit 96678f3

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/callsite-dwarf.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ struct CDerivedOne : CBaseOne {
1010
void foo(int &);
1111
};
1212

13-
void CDerivedOne::foo(int &) {
14-
}
13+
void CDerivedOne::foo(int &) {}
1514

1615
struct CBaseTwo {
1716
CDerivedOne *DerivedOne;
@@ -21,9 +20,7 @@ struct CDerivedTwo : CBaseTwo {
2120
void bar(int &);
2221
};
2322

24-
void CDerivedTwo::bar(int &j) {
25-
DerivedOne->foo(j);
26-
}
23+
void CDerivedTwo::bar(int &j) { DerivedOne->foo(j); }
2724

2825
// The IR generated looks like:
2926
//

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -930,11 +930,10 @@ void DwarfDebug::constructCallSiteEntryDIEs(const DISubprogram &SP,
930930
// Add DW_AT_call_origin with the 'call_target' metadata.
931931
assert(!CallSiteDIE.findAttribute(dwarf::DW_AT_call_origin) &&
932932
"DW_AT_call_origin already exists");
933-
DIE *CalleeDIE = CU.getOrCreateSubprogramDIE(
934-
dyn_cast<DISubprogram>(MD), nullptr);
933+
DIE *CalleeDIE =
934+
CU.getOrCreateSubprogramDIE(dyn_cast<DISubprogram>(MD), nullptr);
935935
assert(CalleeDIE && "Could not create DIE for call site entry origin");
936-
CU.addDIEEntry(CallSiteDIE,
937-
CU.getDwarf5OrGNUAttr(dwarf::DW_AT_call_origin),
936+
CU.addDIEEntry(CallSiteDIE, CU.getDwarf5OrGNUAttr(dwarf::DW_AT_call_origin),
938937
*CalleeDIE);
939938
};
940939

0 commit comments

Comments
 (0)