Remove the last mention of LineTablesOnly from DwarfUnit, sinking it into DwarfCompil...
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 2 Nov 2014 08:18:06 +0000 (08:18 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 2 Nov 2014 08:18:06 +0000 (08:18 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221093 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.h

index c691a2c261b3768cb2ed0c45846cb95bf575d352..485ea34dc5cdade3c53e975ed8be7f778a25b692 100644 (file)
@@ -832,7 +832,8 @@ void DwarfCompileUnit::applySubprogramAttributesToDefinition(DISubprogram SP,
                                                              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
index 8a00f881c9677ddfdee3252e2634fdbf6b1932ce..b29b1631df181c6365808062c501d2c4b25c2086 100644 (file)
@@ -1257,7 +1257,8 @@ DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
   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::applySubprogramAttributes(DISubprogram SP, DIE &SPDie) {
     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);
index 32683c4ebfea28b427cc803dd7bd3f78de9331a4..2c80c124a3ec4c580500b13345c1c995768f11eb 100644 (file)
@@ -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.