diff options
author | Chris Lattner <sabre@nondot.org> | 2012-05-26 23:03:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-05-26 23:03:52 +0000 |
commit | e82d598ef225f1daaf76451291f0808066b0301f (patch) | |
tree | e52fe1e5aea4a4b41ac9c47c8222db7a76d1faa4 /utils | |
parent | 5db954dab9a9e3c57c6e5194bf902a34a458d555 (diff) | |
download | external_llvm-e82d598ef225f1daaf76451291f0808066b0301f.zip external_llvm-e82d598ef225f1daaf76451291f0808066b0301f.tar.gz external_llvm-e82d598ef225f1daaf76451291f0808066b0301f.tar.bz2 |
rearrange some code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/IntrinsicEmitter.cpp | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/utils/TableGen/IntrinsicEmitter.cpp b/utils/TableGen/IntrinsicEmitter.cpp index 226d907..48287d6 100644 --- a/utils/TableGen/IntrinsicEmitter.cpp +++ b/utils/TableGen/IntrinsicEmitter.cpp @@ -389,12 +389,31 @@ static void EncodeFixedType(Record *R, unsigned &NextArgNo, MVT::SimpleValueType VT = getValueType(R->getValueAsDef("VT")); - // If this is an "any" valuetype, then the type is the type of the next - // type in the list specified to getIntrinsic(). - if (VT == MVT::iAny || VT == MVT::fAny || VT == MVT::vAny || - VT == MVT::iPTRAny) { + switch (VT) { + default: break; + case MVT::iAny: + case MVT::fAny: + case MVT::vAny: + case MVT::iPTRAny: + // If this is an "any" valuetype, then the type is the type of the next + // type in the list specified to getIntrinsic(). Sig.push_back(IIT_ARG); return Sig.push_back(NextArgNo++); + + case MVT::iPTR: { + unsigned AddrSpace = 0; + if (R->isSubClassOf("LLVMQualPointerType")) { + AddrSpace = R->getValueAsInt("AddrSpace"); + assert(AddrSpace < 256 && "Address space exceeds 255"); + } + if (AddrSpace) { + Sig.push_back(IIT_ANYPTR); + Sig.push_back(AddrSpace); + } else { + Sig.push_back(IIT_PTR); + } + return EncodeFixedType(R->getValueAsDef("ElTy"), NextArgNo, Sig); + } } if (EVT(VT).isVector()) { @@ -411,22 +430,7 @@ static void EncodeFixedType(Record *R, unsigned &NextArgNo, return EncodeFixedValueType(VVT.getVectorElementType(). getSimpleVT().SimpleTy, Sig); } - - if (VT == MVT::iPTR) { - unsigned AddrSpace = 0; - if (R->isSubClassOf("LLVMQualPointerType")) { - AddrSpace = R->getValueAsInt("AddrSpace"); - assert(AddrSpace < 256 && "Address space exceeds 255"); - } - if (AddrSpace) { - Sig.push_back(IIT_ANYPTR); - Sig.push_back(AddrSpace); - } else { - Sig.push_back(IIT_PTR); - } - return EncodeFixedType(R->getValueAsDef("ElTy"), NextArgNo, Sig); - } - + EncodeFixedValueType(VT, Sig); } |