[TableGen] Implement non-const versions of Record::getValue by delegating to the const versions to avoid duplicate code. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304281 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2017-05-31 05:12:36 +00:00
parent fa336f863c
commit 24c1e7771a

View File

@ -1379,13 +1379,11 @@ public:
}
RecordVal *getValue(const Init *Name) {
for (RecordVal &Val : Values)
if (Val.Name == Name) return &Val;
return nullptr;
return const_cast<RecordVal *>(static_cast<const Record *>(this)->getValue(Name));
}
RecordVal *getValue(StringRef Name) {
return getValue(StringInit::get(Name));
return const_cast<RecordVal *>(static_cast<const Record *>(this)->getValue(Name));
}
void addTemplateArg(Init *Name) {