diff options
Diffstat (limited to 'include/llvm/TableGen/Record.h')
-rw-r--r-- | include/llvm/TableGen/Record.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h index 3aea1ae..a8256b7 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. |