From: Matthias Braun Date: Mon, 5 Dec 2016 05:21:13 +0000 (+0000) Subject: TableGen/Record: Move PointerIntPair to less used field of RecordVal X-Git-Tag: llvmorg-4.0.0-rc1~3026 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1627ff0c83ca5af0f3d05e6e51cb265625218af;p=platform%2Fupstream%2Fllvm.git TableGen/Record: Move PointerIntPair to less used field of RecordVal llvm-svn: 288638 --- diff --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h index 764a5f6..bd7fcff 100644 --- a/llvm/include/llvm/TableGen/Record.h +++ b/llvm/include/llvm/TableGen/Record.h @@ -1220,8 +1220,8 @@ public: //===----------------------------------------------------------------------===// class RecordVal { - PointerIntPair NameAndPrefix; - RecTy *Ty; + Init *Name; + PointerIntPair 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; diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index e705fe89..22773c2 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -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!"); }