diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-04-23 06:41:11 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-04-23 06:41:11 +0000 |
commit | 474e5de72de95414c883fc2759f8a75b20ee42be (patch) | |
tree | f13d33b65158e97a5fc761ac17773af01ee740cd /llvm/lib/CodeGen | |
parent | cdd5ae6676aac86531d0b5fed97f57727d094bc5 (diff) | |
download | bcm5719-llvm-474e5de72de95414c883fc2759f8a75b20ee42be.tar.gz bcm5719-llvm-474e5de72de95414c883fc2759f8a75b20ee42be.zip |
[APInt] Fix a few places that use APInt::getRawData to operate within the normal API.
getRawData exposes the internal type of the APInt class directly to its users. Ideally we wouldn't expose such an implementation detail.
This patch fixes a few of the easy cases by using truncate, extract, or a rotate.
llvm-svn: 301105
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIParser.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index cac22af3295..00003b51787 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -1949,8 +1949,7 @@ bool MIParser::getHexUint(APInt &Result) { return true; StringRef V = S.substr(2); APInt A(V.size()*4, V, 16); - Result = APInt(A.getActiveBits(), - ArrayRef<uint64_t>(A.getRawData(), A.getNumWords())); + Result = A.zextOrTrunc(A.getActiveBits()); return false; } diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp index c1cb5d9b523..c8a9dcbfe23 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp @@ -158,9 +158,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_ConstantFP(SDNode *N, unsigned ResNo) { // and the low 64 bits here. if (DAG.getDataLayout().isBigEndian() && CN->getValueType(0).getSimpleVT() == llvm::MVT::ppcf128) { - uint64_t words[2] = { CN->getValueAPF().bitcastToAPInt().getRawData()[1], - CN->getValueAPF().bitcastToAPInt().getRawData()[0] }; - APInt Val(128, words); + APInt Val = CN->getValueAPF().bitcastToAPInt().rotl(64); return DAG.getConstant(Val, SDLoc(CN), TLI.getTypeToTransformTo(*DAG.getContext(), CN->getValueType(0))); @@ -1060,10 +1058,10 @@ void DAGTypeLegalizer::ExpandFloatRes_ConstantFP(SDNode *N, SDValue &Lo, APInt C = cast<ConstantFPSDNode>(N)->getValueAPF().bitcastToAPInt(); SDLoc dl(N); Lo = DAG.getConstantFP(APFloat(DAG.EVTToAPFloatSemantics(NVT), - APInt(64, C.getRawData()[1])), + C.extractBits(64, 64)), dl, NVT); Hi = DAG.getConstantFP(APFloat(DAG.EVTToAPFloatSemantics(NVT), - APInt(64, C.getRawData()[0])), + C.extractBits(64, 0)), dl, NVT); } |