summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorSourabh Singh Tomar <SourabhSingh.Tomar@amd.com>2019-12-24 11:38:38 +0530
committerSourabh Singh Tomar <SourabhSingh.Tomar@amd.com>2019-12-24 12:50:34 +0530
commit0a72515d33bb1931ca8ad4022f743a33a203ea33 (patch)
tree93410f7595c93114da63b32a708dd1b6c9a0abd4 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parente0d855b39974bc40dee0f722884894098be6d420 (diff)
downloadbcm5719-llvm-0a72515d33bb1931ca8ad4022f743a33a203ea33.tar.gz
bcm5719-llvm-0a72515d33bb1931ca8ad4022f743a33a203ea33.zip
[DebugInfo] Fix v4 macinfo for dwo files.
Dwo files must contain have DW_AT_macro_info attribute, when macro information is emitted. Adjusted the test case for the same.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 624e1a513ec..b91f613f1ce 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1193,10 +1193,15 @@ void DwarfDebug::finalizeModuleInfo() {
auto *CUNode = cast<DICompileUnit>(P.first);
// If compile Unit has macros, emit "DW_AT_macro_info" attribute.
- if (CUNode->getMacros() && !useSplitDwarf())
- U.addSectionLabel(U.getUnitDie(), dwarf::DW_AT_macro_info,
- U.getMacroLabelBegin(),
- TLOF.getDwarfMacinfoSection()->getBeginSymbol());
+ if (CUNode->getMacros())
+ if (useSplitDwarf())
+ TheCU.addLabelDelta(TheCU.getUnitDie(), dwarf::DW_AT_macro_info,
+ U.getMacroLabelBegin(),
+ TLOF.getDwarfMacinfoDWOSection()->getBeginSymbol());
+ else
+ U.addSectionLabel(U.getUnitDie(), dwarf::DW_AT_macro_info,
+ U.getMacroLabelBegin(),
+ TLOF.getDwarfMacinfoSection()->getBeginSymbol());
}
// Emit all frontend-produced Skeleton CUs, i.e., Clang modules.
OpenPOWER on IntegriCloud