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 | 3e1ef7849845a9e7bf79156bbb8a2c26d77a1d2e (patch) | |
tree | d3e5ed7e0e91550b253f872f5eed53c48958d158 /lib/AST/ExprConstant.cpp | |
parent | 5b8968cc599eb6100bb73ae87be9d6cd2577ac9e (diff) |
Use the new APFloat::convertToInt(APSInt) function to simplify uses of
convertToInt(integerParts*) and make them more reliable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 987b02bb8f..786155af28 100644 --- a/lib/AST/ExprConstant.cpp +++ b/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, |