summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2018-05-18 03:13:08 +0000
committerEric Christopher <echristo@gmail.com>2018-05-18 03:13:08 +0000
commit68f2218e1efdb74442987a2040876e2e41f7d90e (patch)
treed023e496103dcdabd7e78295704e0f861199856f /llvm/lib/CodeGen
parent3aede9283cc0a7cc1788c29e040e0f4e7439ba96 (diff)
downloadbcm5719-llvm-68f2218e1efdb74442987a2040876e2e41f7d90e.tar.gz
bcm5719-llvm-68f2218e1efdb74442987a2040876e2e41f7d90e.zip
Revert "Temporarily revert "[DEBUG] Initial adaptation of NVPTX target for debug info emission.""
This reapplies commits: r330271, r330592, r330779. [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. llvm-svn: 332689
Diffstat (limited to 'llvm/lib/CodeGen')
-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