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