mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-11 13:44:28 +00:00
[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:
parent
7b436b03da
commit
fa336f863c
@ -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
Block a user