diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 9478453b4ca..0723eb85a28 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -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 &DIEs = AccelNames[Name]; DIEs.push_back(Die); } void DwarfUnit::addAccelObjC(StringRef Name, const DIE *Die) { + if (!DD->useDwarfAccelTables()) return; DU->getStringPoolEntry(Name); std::vector &DIEs = AccelObjC[Name]; DIEs.push_back(Die); } void DwarfUnit::addAccelNamespace(StringRef Name, const DIE *Die) { + if (!DD->useDwarfAccelTables()) return; DU->getStringPoolEntry(Name); std::vector &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 Die) { + if (!DD->useDwarfAccelTables()) return; DU->getStringPoolEntry(Name); std::vector > &DIEs = AccelTypes[Name]; DIEs.push_back(Die);