summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
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 7dd76b38608..4f61fca4343 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