[TableGen] Make one of RecordVal's constructors delegate to the other to reduce duplicate code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304280 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2017-05-31 05:12:33 +00:00
parent 7b436b03da
commit fa336f863c
2 changed files with 2 additions and 7 deletions

View File

@ -1237,7 +1237,8 @@ class RecordVal {
public:
RecordVal(Init *N, RecTy *T, bool P);
RecordVal(StringRef N, RecTy *T, bool P);
RecordVal(StringRef N, RecTy *T, bool P)
: RecordVal(StringInit::get(N), T, P) {}
StringRef getName() const;
Init *getNameInit() const { return Name; }

View File

@ -1572,12 +1572,6 @@ RecordVal::RecordVal(Init *N, RecTy *T, bool P)
assert(Value && "Cannot create unset value for current type!");
}
RecordVal::RecordVal(StringRef N, RecTy *T, bool P)
: Name(StringInit::get(N)), TyAndPrefix(T, P) {
Value = UnsetInit::get()->convertInitializerTo(T);
assert(Value && "Cannot create unset value for current type!");
}
StringRef RecordVal::getName() const {
return cast<StringInit>(getNameInit())->getValue();
}