forked from OSchip/llvm-project
[TableGen] Make one of RecordVal's constructors delegate to the other to reduce duplicate code.
llvm-svn: 304280
This commit is contained in:
parent
5863087ad3
commit
01197f686f
|
@ -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; }
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue