summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-04-18 16:13:41 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-04-18 16:13:41 +0000
commit242706b8d187ee70c9da3737dd8414b7a762a42b (patch)
tree9d05f5e71bc02dc19ea9234f5b2854199a5a65e1 /llvm/lib/CodeGen/AsmPrinter
parente372710d30c66e020576a2af6e1e5e815815a65a (diff)
downloadbcm5719-llvm-242706b8d187ee70c9da3737dd8414b7a762a42b.tar.gz
bcm5719-llvm-242706b8d187ee70c9da3737dd8414b7a762a42b.zip
[DEBUG] Initial adaptation of NVPTX target for debug info emission.
Summary: Patch adds initial emission of the debug info for NVPTX target. Currently, only .file and .loc directives are emitted, everything else is commented out to not break the compilation of Cuda. Reviewers: echristo, jlebar, tra, jholewinski Subscribers: mgorny, aprantl, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D41827 llvm-svn: 330271
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index a8e36ec66e5..c8740d72b00 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -312,7 +312,11 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
} else
TheAccelTableKind = AccelTables;
- UseInlineStrings = DwarfInlinedStrings == Enable;
+ if (DwarfInlinedStrings == Default)
+ UseInlineStrings = TT.isNVPTX();
+ else
+ UseInlineStrings = DwarfInlinedStrings == Enable;
+
HasAppleExtensionAttributes = tuneForLLDB();
// Handle split DWARF.
@@ -327,14 +331,18 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
unsigned DwarfVersionNumber = Asm->TM.Options.MCOptions.DwarfVersion;
unsigned DwarfVersion = DwarfVersionNumber ? DwarfVersionNumber
: MMI->getModule()->getDwarfVersion();
- // Use dwarf 4 by default if nothing is requested.
- DwarfVersion = DwarfVersion ? DwarfVersion : dwarf::DWARF_VERSION;
+ // Use dwarf 4 by default if nothing is requested. For NVPTX, use dwarf 2.
+ DwarfVersion =
+ TT.isNVPTX() ? 2 : (DwarfVersion ? DwarfVersion : dwarf::DWARF_VERSION);
- UsePubSections = !NoDwarfPubSections;
- UseRangesSection = !NoDwarfRangesSection;
+ UsePubSections = !NoDwarfPubSections && !TT.isNVPTX();
+ UseRangesSection = !NoDwarfRangesSection && !TT.isNVPTX();
- // Use sections as references.
- UseSectionsAsReferences = DwarfSectionsAsReferences == Enable;
+ // Use sections as references. Force for NVPTX.
+ if (DwarfSectionsAsReferences == Default)
+ UseSectionsAsReferences = TT.isNVPTX();
+ else
+ UseSectionsAsReferences = DwarfSectionsAsReferences == Enable;
// Work around a GDB bug. GDB doesn't support the standard opcode;
// SCE doesn't support GNU's; LLDB prefers the standard opcode, which
OpenPOWER on IntegriCloud