diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 8 |
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. |

