TableGen: delete no-op code
authorDylan Noblesmith <nobled@dreamwidth.org>
Sun, 24 Aug 2014 19:10:53 +0000 (19:10 +0000)
committerDylan Noblesmith <nobled@dreamwidth.org>
Sun, 24 Aug 2014 19:10:53 +0000 (19:10 +0000)
This does nothing but remove the Record from the map, and
then re-add it, without actually changing it in between.

The Record's Name used to be changed before re-adding it
when the code was first committed in r137232, but the
name-changing lines were removed in r142510, and since
then this code seems to do nothing.

This was also the only caller of removeClass or removeDef,
so now RecordKeeper owns its Records unconditionally,
and could be unique_ptr-ified.

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

include/llvm/TableGen/Record.h
lib/TableGen/Record.cpp

index 5aec728ae1900a9aa929183488628adad818c199..5f610a6930d07974b38f6bd620a6f4ccc55b4bd4 100644 (file)
@@ -1684,19 +1684,6 @@ public:
     assert(Ins && "Record already exists");
   }
 
-  /// removeClass - Remove, but do not delete, the specified record.
-  ///
-  void removeClass(const std::string &Name) {
-    assert(Classes.count(Name) && "Class does not exist!");
-    Classes.erase(Name);
-  }
-  /// removeDef - Remove, but do not delete, the specified record.
-  ///
-  void removeDef(const std::string &Name) {
-    assert(Defs.count(Name) && "Def does not exist!");
-    Defs.erase(Name);
-  }
-
   //===--------------------------------------------------------------------===//
   // High-level helper methods, useful for tablegen backends...
 
index 5ee28c9370a9801faa665e8432bd40d3694452d0..d4800c4e7a9e542fd7515d4595eed2a225cbdd81 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