diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2018-03-20 16:04:40 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-03-20 16:04:40 +0000 |
| commit | 648ed2dedbf9ff5e245fd9763558f2492592e173 (patch) | |
| tree | 683de84176ea566ef963322d3e8490f206b664c6 /llvm/lib | |
| parent | dca06024e877e37e3631bd6a378c3945317dae85 (diff) | |
| download | bcm5719-llvm-648ed2dedbf9ff5e245fd9763558f2492592e173.tar.gz bcm5719-llvm-648ed2dedbf9ff5e245fd9763558f2492592e173.zip | |
[DEBUGINFO] Add flag -no-dwarf-pub-sections to disable pub sections.
Summary:
Added a flag -no-dwarf-pub-sections, which allows to disable
emission of DWARF public sections.
Reviewers: probinson, echristo
Subscribers: aprantl, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D44385
llvm-svn: 327994
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 6 |
3 files changed, 15 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 713a9763a7f..0ff1b5004d9 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -851,7 +851,8 @@ bool DwarfCompileUnit::hasDwarfPubSections() const { if (CUNode->getGnuPubnames()) return true; - return DD->tuneForGDB() && !includeMinimalInlineScopes(); + return DD->tuneForGDB() && DD->usePubSections() && + !includeMinimalInlineScopes(); } /// addGlobalName - Add a new global name to the compile unit. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index a1e9a01e72b..b9a17d5018c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -123,6 +123,11 @@ DwarfInlinedStrings("dwarf-inlined-strings", cl::Hidden, clEnumVal(Disable, "Disabled")), cl::init(Default)); +static cl::opt<bool> + NoDwarfPubSections("no-dwarf-pub-sections", cl::Hidden, + cl::desc("Disable emission of DWARF pub sections."), + cl::init(false)); + enum LinkageNameOption { DefaultLinkageNames, AllLinkageNames, @@ -310,6 +315,8 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) // Use dwarf 4 by default if nothing is requested. DwarfVersion = DwarfVersion ? DwarfVersion : dwarf::DWARF_VERSION; + UsePubSections = !NoDwarfPubSections; + // Work around a GDB bug. GDB doesn't support the standard opcode; // SCE doesn't support GNU's; LLDB prefers the standard opcode, which // is defined as of DWARF 3. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index c8a36baffe3..56a1d633729 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -258,6 +258,9 @@ class DwarfDebug : public DebugHandlerBase { /// Use inlined strings. bool UseInlineStrings = false; + /// Whether to emit DWARF pub sections or not. + bool UsePubSections = true; + /// DWARF5 Experimental Options /// @{ bool HasDwarfAccelTables; @@ -501,6 +504,9 @@ public: /// Returns whether to use inline strings. bool useInlineStrings() const { return UseInlineStrings; } + /// Returns whether GNU oub sections should be emitted. + bool usePubSections() const { return UsePubSections; } + // Experimental DWARF5 features. /// Returns whether or not to emit tables that dwarf consumers can |

