[llvm] r221093 - Remove the last mention of LineTablesOnly from DwarfUnit, sinking it into DwarfCompileUnit
David Blaikie
dblaikie at gmail.com
Sun Nov 2 01:18:06 PDT 2014
Author: dblaikie
Date: Sun Nov 2 02:18:06 2014
New Revision: 221093
URL: http://llvm.org/viewvc/llvm-project?rev=221093&view=rev
Log:
Remove the last mention of LineTablesOnly from DwarfUnit, sinking it into DwarfCompileUnit
This is a useful distinction/invariant/delination to make because
LineTablesOnly mode is never relevant to type units, so it's clear that
we're not doing weird line-tables-only-with-types by making this API
choice.
It also lays the foundations nicely for adding gmlt-like data to fission
skeleton CUs while limiting the effects to CUs and not TUs.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=221093&r1=221092&r2=221093&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Sun Nov 2 02:18:06 2014
@@ -832,7 +832,8 @@ void DwarfCompileUnit::applySubprogramAt
DIE &SPDie) {
DISubprogram SPDecl = SP.getFunctionDeclaration();
DIScope Context = resolve(SPDecl ? SPDecl.getContext() : SP.getContext());
- applySubprogramAttributes(SP, SPDie);
+ applySubprogramAttributes(SP, SPDie, getCUNode().getEmissionKind() ==
+ DIBuilder::LineTablesOnly);
addGlobalName(SP.getName(), SPDie, Context);
}
} // end llvm namespace
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=221093&r1=221092&r2=221093&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Sun Nov 2 02:18:06 2014
@@ -1257,7 +1257,8 @@ DIE *DwarfUnit::getOrCreateSubprogramDIE
return &SPDie;
}
-void DwarfUnit::applySubprogramAttributes(DISubprogram SP, DIE &SPDie) {
+void DwarfUnit::applySubprogramAttributes(DISubprogram SP, DIE &SPDie,
+ bool Minimal) {
DIE *DeclDie = nullptr;
StringRef DeclLinkageName;
if (DISubprogram SPDecl = SP.getFunctionDeclaration()) {
@@ -1292,7 +1293,7 @@ void DwarfUnit::applySubprogramAttribute
addString(SPDie, dwarf::DW_AT_name, SP.getName());
// Skip the rest of the attributes under -gmlt to save space.
- if(getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly)
+ if (Minimal)
return;
addSourceLine(SPDie, SP);
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=221093&r1=221092&r2=221093&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Sun Nov 2 02:18:06 2014
@@ -299,7 +299,8 @@ public:
/// getOrCreateSubprogramDIE - Create new DIE using SP.
DIE *getOrCreateSubprogramDIE(DISubprogram SP);
- void applySubprogramAttributes(DISubprogram SP, DIE &SPDie);
+ void applySubprogramAttributes(DISubprogram SP, DIE &SPDie,
+ bool Minimal = false);
/// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
/// given DIType.
More information about the llvm-commits
mailing list