llvm.org GIT mirror llvm / d52b1d0
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 Dylan Noblesmith 6 years ago
2 changed file(s) with 0 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
16831683 assert(Ins && "Record already exists");
16841684 }
16851685
1686 /// removeClass - Remove, but do not delete, the specified record.
1687 ///
1688 void removeClass(const std::string &Name) {
1689 assert(Classes.count(Name) && "Class does not exist!");
1690 Classes.erase(Name);
1691 }
1692 /// removeDef - Remove, but do not delete, the specified record.
1693 ///
1694 void removeDef(const std::string &Name) {
1695 assert(Defs.count(Name) && "Def does not exist!");
1696 Defs.erase(Name);
1697 }
1698
16991686 //===--------------------------------------------------------------------===//
17001687 // High-level helper methods, useful for tablegen backends...
17011688
17071707 }
17081708
17091709 void Record::setName(Init *NewName) {
1710 if (TrackedRecords.getDef(Name->getAsUnquotedString()) == this) {
1711 TrackedRecords.removeDef(Name->getAsUnquotedString());
1712 TrackedRecords.addDef(this);
1713 } else if (TrackedRecords.getClass(Name->getAsUnquotedString()) == this) {
1714 TrackedRecords.removeClass(Name->getAsUnquotedString());
1715 TrackedRecords.addClass(this);
1716 } // Otherwise this isn't yet registered.
17171710 Name = NewName;
17181711 checkName();
17191712 // DO NOT resolve record values to the name at this point because