diff options
author | Vedant Kumar <vsk@apple.com> | 2019-08-26 20:53:12 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2019-08-26 20:53:12 +0000 |
commit | 533dd0214c05bb4547a20b6733d75fff551bafb3 (patch) | |
tree | 52cd93a0f0801a436dd48a4f852967fa372e36a8 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 1e4241cad7c7cde057a640029cb4de47cb7307c4 (diff) | |
download | bcm5719-llvm-533dd0214c05bb4547a20b6733d75fff551bafb3.tar.gz bcm5719-llvm-533dd0214c05bb4547a20b6733d75fff551bafb3.zip |
[DWARF] Pick the DWARF5 OP_entry_value opcode on Darwin
Use the GNU extension for OP_entry_value consistently (i.e. whenever GNU
extensions are used for TAG_call_site).
llvm-svn: 369966
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 46c8bd8a0ed..4ed452d61d5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -892,9 +892,13 @@ void DwarfCompileUnit::constructAbstractSubprogramScopeDIE( ContextCU->addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); } +/// Whether to use the GNU analog for a DWARF5 tag, attribute, or location atom. +static bool useGNUAnalogForDwarf5Feature(DwarfDebug *DD) { + return DD->getDwarfVersion() == 4 && DD->tuneForGDB(); +} + dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUCallSiteTag(dwarf::Tag Tag) const { - bool ApplyGNUExtensions = DD->getDwarfVersion() == 4 && DD->tuneForGDB(); - if (!ApplyGNUExtensions) + if (!useGNUAnalogForDwarf5Feature(DD)) return Tag; switch (Tag) { case dwarf::DW_TAG_call_site: @@ -908,8 +912,7 @@ dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUCallSiteTag(dwarf::Tag Tag) const { dwarf::Attribute DwarfCompileUnit::getDwarf5OrGNUCallSiteAttr(dwarf::Attribute Attr) const { - bool ApplyGNUExtensions = DD->getDwarfVersion() == 4 && DD->tuneForGDB(); - if (!ApplyGNUExtensions) + if (!useGNUAnalogForDwarf5Feature(DD)) return Attr; switch (Attr) { case dwarf::DW_AT_call_all_calls: @@ -929,6 +932,18 @@ DwarfCompileUnit::getDwarf5OrGNUCallSiteAttr(dwarf::Attribute Attr) const { } } +dwarf::LocationAtom +DwarfCompileUnit::getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const { + if (!useGNUAnalogForDwarf5Feature(DD)) + return Loc; + switch (Loc) { + case dwarf::DW_OP_entry_value: + return dwarf::DW_OP_GNU_entry_value; + default: + llvm_unreachable("DWARF5 location atom with no GNU analog"); + } +} + DIE &DwarfCompileUnit::constructCallSiteEntryDIE( DIE &ScopeDIE, const DISubprogram *CalleeSP, bool IsTail, const MCSymbol *PCAddr, const MCExpr *PCOffset, unsigned CallReg) { |