From d52b1d08df93df399659fdbef54e4a2031ebe007 Mon Sep 17 00:00:00 2001 From: Dylan Noblesmith Date: Sun, 24 Aug 2014 19:10:53 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216349 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/TableGen/Record.h | 13 ------------- lib/TableGen/Record.cpp | 7 ------- 2 files changed, 20 deletions(-) diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h index 5aec728ae19..5f610a6930d 100644 --- a/include/llvm/TableGen/Record.h +++ b/include/llvm/TableGen/Record.h @@ -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... diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 5ee28c9370a..d4800c4e7a9 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -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