summaryrefslogtreecommitdiff
path: root/include/llvm/TableGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-24 22:17:36 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-24 22:17:36 +0000
commit72cba6cdf640411e2fb6207858a0abd87c4286fc (patch)
treeea65f3d9cbaba881b40a3be74efdafb0b579f19f /include/llvm/TableGen
parent8e5286e18ffbe4716ef92cd1de8901942d685e1b (diff)
downloadllvm-72cba6cdf640411e2fb6207858a0abd87c4286fc.tar.gz
llvm-72cba6cdf640411e2fb6207858a0abd87c4286fc.tar.bz2
llvm-72cba6cdf640411e2fb6207858a0abd87c4286fc.tar.xz
Don't put TGParser scratch results in the output.
Only fully expanded Records should go into RecordKeeper. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157431 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/TableGen')
-rw-r--r--include/llvm/TableGen/Record.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h
index 3aea1aeaea..a8256b7735 100644
--- a/include/llvm/TableGen/Record.h
+++ b/include/llvm/TableGen/Record.h
@@ -1558,12 +1558,14 @@ public:
return I == Defs.end() ? 0 : I->second;
}
void addClass(Record *R) {
- assert(getClass(R->getNameInitAsString()) == 0 && "Class already exists!");
- Classes.insert(std::make_pair(R->getNameInitAsString(), R));
+ bool Ins = Classes.insert(std::make_pair(R->getName(), R)).second;
+ (void)Ins;
+ assert(Ins && "Class already exists");
}
void addDef(Record *R) {
- assert(getDef(R->getNameInitAsString()) == 0 && "Def already exists!");
- Defs.insert(std::make_pair(R->getNameInitAsString(), R));
+ bool Ins = Defs.insert(std::make_pair(R->getName(), R)).second;
+ (void)Ins;
+ assert(Ins && "Record already exists");
}
/// removeClass - Remove, but do not delete, the specified record.