[llvm] r216349 - TableGen: delete no-op code

Dylan Noblesmith nobled at dreamwidth.org
Sun Aug 24 12:10:53 PDT 2014


Author: nobled
Date: Sun Aug 24 14:10:53 2014
New Revision: 216349

URL: http://llvm.org/viewvc/llvm-project?rev=216349&view=rev
Log:
TableGen: delete no-op code

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.

Modified:
    llvm/trunk/include/llvm/TableGen/Record.h
    llvm/trunk/lib/TableGen/Record.cpp

Modified: llvm/trunk/include/llvm/TableGen/Record.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=216349&r1=216348&r2=216349&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h (original)
+++ llvm/trunk/include/llvm/TableGen/Record.h Sun Aug 24 14:10:53 2014
@@ -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...
 

Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=216349&r1=216348&r2=216349&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Sun Aug 24 14:10:53 2014
@@ -1708,13 +1708,6 @@ const std::string &Record::getName() con
 }
 
 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





More information about the llvm-commits mailing list