When merging two common GlobalValues, keep the largest.
[oota-llvm.git] / lib / TableGen / Record.cpp
index 5ee28c9370a9801faa665e8432bd40d3694452d0..34e3ab4a2e3af7189ec426b4f5104de7aa789c58 100644 (file)
@@ -1708,13 +1708,6 @@ const std::string &Record::getName() const {
 }
 
 void Record::setName(Init *NewName) {
-  if (TrackedRecords.getDef(Name->getAsUnquotedString()) == this) {
-    TrackedRecords.removeDef(Name->getAsUnquotedString());
-    TrackedRecords.addDef(this);
-  } else if (TrackedRecords.getClass(Name->getAsUnquotedString()) == this) {
-    TrackedRecords.removeClass(Name->getAsUnquotedString());
-    TrackedRecords.addClass(this);
-  }  // Otherwise this isn't yet registered.
   Name = NewName;
   checkName();
   // DO NOT resolve record values to the name at this point because
@@ -2038,7 +2031,7 @@ RecordKeeper::getAllDerivedDefinitions(const std::string &ClassName) const {
   std::vector<Record*> Defs;
   for (const auto &D : getDefs())
     if (D.second->isSubClassOf(Class))
-      Defs.push_back(D.second);
+      Defs.push_back(D.second.get());
 
   return Defs;
 }