mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-04 17:58:22 +00:00
TableGen/Record: Move PointerIntPair to less used field of RecordVal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288638 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
38492abcd5
commit
ccd8fece37
@ -1220,8 +1220,8 @@ public:
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
class RecordVal {
|
class RecordVal {
|
||||||
PointerIntPair<Init *, 1, bool> NameAndPrefix;
|
Init *Name;
|
||||||
RecTy *Ty;
|
PointerIntPair<RecTy *, 1, bool> TyAndPrefix;
|
||||||
Init *Value;
|
Init *Value;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -1229,19 +1229,19 @@ public:
|
|||||||
RecordVal(StringRef N, RecTy *T, bool P);
|
RecordVal(StringRef N, RecTy *T, bool P);
|
||||||
|
|
||||||
StringRef getName() const;
|
StringRef getName() const;
|
||||||
const Init *getNameInit() const { return NameAndPrefix.getPointer(); }
|
const Init *getNameInit() const { return Name; }
|
||||||
|
|
||||||
std::string getNameInitAsString() const {
|
std::string getNameInitAsString() const {
|
||||||
return getNameInit()->getAsUnquotedString();
|
return getNameInit()->getAsUnquotedString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getPrefix() const { return NameAndPrefix.getInt(); }
|
bool getPrefix() const { return TyAndPrefix.getInt(); }
|
||||||
RecTy *getType() const { return Ty; }
|
RecTy *getType() const { return TyAndPrefix.getPointer(); }
|
||||||
Init *getValue() const { return Value; }
|
Init *getValue() const { return Value; }
|
||||||
|
|
||||||
bool setValue(Init *V) {
|
bool setValue(Init *V) {
|
||||||
if (V) {
|
if (V) {
|
||||||
Value = V->convertInitializerTo(Ty);
|
Value = V->convertInitializerTo(getType());
|
||||||
return Value == nullptr;
|
return Value == nullptr;
|
||||||
}
|
}
|
||||||
Value = nullptr;
|
Value = nullptr;
|
||||||
|
@ -1615,14 +1615,14 @@ std::string DagInit::getAsString() const {
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
RecordVal::RecordVal(Init *N, RecTy *T, bool P)
|
RecordVal::RecordVal(Init *N, RecTy *T, bool P)
|
||||||
: NameAndPrefix(N, P), Ty(T) {
|
: Name(N), TyAndPrefix(T, P) {
|
||||||
Value = UnsetInit::get()->convertInitializerTo(Ty);
|
Value = UnsetInit::get()->convertInitializerTo(T);
|
||||||
assert(Value && "Cannot create unset value for current type!");
|
assert(Value && "Cannot create unset value for current type!");
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordVal::RecordVal(StringRef N, RecTy *T, bool P)
|
RecordVal::RecordVal(StringRef N, RecTy *T, bool P)
|
||||||
: NameAndPrefix(StringInit::get(N), P), Ty(T) {
|
: Name(StringInit::get(N)), TyAndPrefix(T, P) {
|
||||||
Value = UnsetInit::get()->convertInitializerTo(Ty);
|
Value = UnsetInit::get()->convertInitializerTo(T);
|
||||||
assert(Value && "Cannot create unset value for current type!");
|
assert(Value && "Cannot create unset value for current type!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user