summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-06-29 14:23:28 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-06-29 14:23:28 +0000
commit2a03d4296a5e462855dd43c9808f406a4f1cea16 (patch)
tree2e0a148fd6cf20f5385c0ce73ede9f467008581c /llvm/lib/CodeGen/AsmPrinter
parentce3a66804a5bc42773d6d226df89addbfc43ccf3 (diff)
downloadbcm5719-llvm-2a03d4296a5e462855dd43c9808f406a4f1cea16.tar.gz
bcm5719-llvm-2a03d4296a5e462855dd43c9808f406a4f1cea16.zip
[DEBUG_INFO, NVPTX] Do not emit .debug_loc section.
Summary: .debug_loc section is not supported for NVPTX target. If there is an object whose location can change during its lifetime, we do not generate debug location info for this variable. Reviewers: echristo Subscribers: jholewinski, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D48730 llvm-svn: 335976
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp5
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h8
2 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index c7688141803..a33bda34630 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -317,6 +317,8 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
else
UseInlineStrings = DwarfInlinedStrings == Enable;
+ UseLocSection = !TT.isNVPTX();
+
HasAppleExtensionAttributes = tuneForLLDB();
// Handle split DWARF.
@@ -1196,6 +1198,9 @@ void DwarfDebug::collectVariableInfo(DwarfCompileUnit &TheCU,
RegVar->initializeDbgValue(MInsn);
continue;
}
+ // Do not emit location lists if .debug_loc secton is disabled.
+ if (!useLocSection())
+ continue;
// Handle multiple DBG_VALUE instructions describing one variable.
DebugLocStream::ListBuilder List(DebugLocs, TheCU, *Asm, *RegVar, *MInsn);
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index f01d68028eb..54f0e5b6a79 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -276,6 +276,9 @@ class DwarfDebug : public DebugHandlerBase {
/// temp symbols inside DWARF sections.
bool UseSectionsAsReferences = false;
+ ///Allow emission of the .debug_loc section.
+ bool UseLocSection = true;
+
/// DWARF5 Experimental Options
/// @{
AccelTableKind TheAccelTableKind;
@@ -526,7 +529,7 @@ public:
/// Returns whether to use inline strings.
bool useInlineStrings() const { return UseInlineStrings; }
- /// Returns whether GNU oub sections should be emitted.
+ /// Returns whether GNU pub sections should be emitted.
bool usePubSections() const { return UsePubSections; }
/// Returns whether ranges section should be emitted.
@@ -537,6 +540,9 @@ public:
return UseSectionsAsReferences;
}
+ /// Returns whether .debug_loc section should be emitted.
+ bool useLocSection() const { return UseLocSection; }
+
// Experimental DWARF5 features.
/// Returns what kind (if any) of accelerator tables to emit.
OpenPOWER on IntegriCloud