diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2011-07-15 17:03:07 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2011-07-15 17:03:07 +0000 |
commit | d0f079dad4e117191c929a84fc72a6e9d1e7252b (patch) | |
tree | 98acbbdc0110122c00c30f653384a32699c36172 /clang/lib/AST | |
parent | f5f352dda534ea676a2ddb00f8bc36dbd129974e (diff) | |
download | bcm5719-llvm-d0f079dad4e117191c929a84fc72a6e9d1e7252b.tar.gz bcm5719-llvm-d0f079dad4e117191c929a84fc72a6e9d1e7252b.zip |
Use the new APFloat::convertToInt(APSInt) function to simplify uses of
convertToInt(integerParts*) and make them more reliable.
llvm-svn: 135279
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 987b02bb8ff..786155af281 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -224,11 +224,10 @@ static APSInt HandleFloatToIntCast(QualType DestType, QualType SrcType, bool DestSigned = DestType->isSignedIntegerOrEnumerationType(); // FIXME: Warning for overflow. - uint64_t Space[4]; + APSInt Result(DestWidth, !DestSigned); bool ignored; - (void)Value.convertToInteger(Space, DestWidth, DestSigned, - llvm::APFloat::rmTowardZero, &ignored); - return APSInt(llvm::APInt(DestWidth, 4, Space), !DestSigned); + (void)Value.convertToInteger(Result, llvm::APFloat::rmTowardZero, &ignored); + return Result; } static APFloat HandleFloatToFloatCast(QualType DestType, QualType SrcType, |