If we're not producing DWARF accel tables, don't waste memory
authorPaul Robinson <paul_robinson@playstation.sony.com>
Fri, 31 Jan 2014 20:39:19 +0000 (20:39 +0000)
committerPaul Robinson <paul_robinson@playstation.sony.com>
Fri, 31 Jan 2014 20:39:19 +0000 (20:39 +0000)
keeping track of those entries.

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

lib/CodeGen/AsmPrinter/DwarfUnit.cpp

index 9478453b4ca98ab95ad23478eab2e237b768e436..0723eb85a28a36d99c253e8de043429736376b5b 100644 (file)
@@ -1016,18 +1016,21 @@ void DwarfUnit::addType(DIE *Entity, DIType Ty, dwarf::Attribute Attribute) {
 // to reference is in the string table. We do this since the names we
 // add may not only be identical to the names in the DIE.
 void DwarfUnit::addAccelName(StringRef Name, const DIE *Die) {
+  if (!DD->useDwarfAccelTables()) return;
   DU->getStringPoolEntry(Name);
   std::vector<const DIE *> &DIEs = AccelNames[Name];
   DIEs.push_back(Die);
 }
 
 void DwarfUnit::addAccelObjC(StringRef Name, const DIE *Die) {
+  if (!DD->useDwarfAccelTables()) return;
   DU->getStringPoolEntry(Name);
   std::vector<const DIE *> &DIEs = AccelObjC[Name];
   DIEs.push_back(Die);
 }
 
 void DwarfUnit::addAccelNamespace(StringRef Name, const DIE *Die) {
+  if (!DD->useDwarfAccelTables()) return;
   DU->getStringPoolEntry(Name);
   std::vector<const DIE *> &DIEs = AccelNamespace[Name];
   DIEs.push_back(Die);
@@ -1035,6 +1038,7 @@ void DwarfUnit::addAccelNamespace(StringRef Name, const DIE *Die) {
 
 void DwarfUnit::addAccelType(StringRef Name,
                              std::pair<const DIE *, unsigned> Die) {
+  if (!DD->useDwarfAccelTables()) return;
   DU->getStringPoolEntry(Name);
   std::vector<std::pair<const DIE *, unsigned> > &DIEs = AccelTypes[Name];
   DIEs.push_back(Die);