summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2011-10-19 13:03:25 +0000
committerDavid Greene <greened@obbligato.org>2011-10-19 13:03:25 +0000
commitf651a2a5c026db7f467648f51a3d68a62976d6b1 (patch)
tree0f90d8b3cf556e6be6317f09d1e1e1de2c2b7a05 /llvm/lib/TableGen
parent212f6a9e9a2745b5c4f8e5caefcbc9b5f9b1592f (diff)
downloadbcm5719-llvm-f651a2a5c026db7f467648f51a3d68a62976d6b1.tar.gz
bcm5719-llvm-f651a2a5c026db7f467648f51a3d68a62976d6b1.zip
Allow Names Changes on Unregistered Records
Add Record names to be changed even on Records that aren't yet registered. We need to be able to do this for paste functionality because we do not want to register def names before they are unique and that can only happen once all paste operations are done. This change lets us update Record names formed by paste operations and register the result later. llvm-svn: 142510
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/Record.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index c92f1b2f614..69d31fe3b43 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -1714,13 +1714,12 @@ const std::string &Record::getName() const {
void Record::setName(Init *NewName) {
if (TrackedRecords.getDef(Name->getAsUnquotedString()) == this) {
TrackedRecords.removeDef(Name->getAsUnquotedString());
- Name = NewName;
TrackedRecords.addDef(this);
- } else {
+ } else if (TrackedRecords.getClass(Name->getAsUnquotedString()) == this) {
TrackedRecords.removeClass(Name->getAsUnquotedString());
- Name = NewName;
TrackedRecords.addClass(this);
- }
+ } // Otherwise this isn't yet registered.
+ Name = NewName;
checkName();
// Since the Init for the name was changed, see if we can resolve
// any of it using members of the Record.
OpenPOWER on IntegriCloud