summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-11-25 19:00:29 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-11-25 19:00:29 +0000
commit2e5aeff67692e7093fb32b0aeb1b0ca176151be5 (patch)
tree54ad8563a5f94e750017d0ca1203e2a11c879a2e /llvm/lib
parentbb1298e6d4bc19ec83196f20ced1f00aba953252 (diff)
downloadbcm5719-llvm-2e5aeff67692e7093fb32b0aeb1b0ca176151be5.tar.gz
bcm5719-llvm-2e5aeff67692e7093fb32b0aeb1b0ca176151be5.zip
convertToSignExtendedInteger should return opInvalidOp instead of asserting if sematics of float does not allow arithmetics.
llvm-svn: 60042
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/APFloat.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index a65e55afb56..128fee4f01f 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -117,6 +117,11 @@ namespace {
&& "Compile-time arithmetic does not support these semantics");
}
+ static inline bool
+ isArithmeticOk(const llvm::fltSemantics &semantics) {
+ return semantics.arithmeticOK;
+ }
+
/* Return the value of a decimal exponent of the form
[+-]ddddddd.
@@ -1787,7 +1792,8 @@ APFloat::convertToSignExtendedInteger(integerPart *parts, unsigned int width,
const integerPart *src;
unsigned int dstPartsCount, truncatedBits;
- assertArithmeticOK(*semantics);
+ if (!isArithmeticOk(*semantics))
+ return opInvalidOp;
*isExact = false;
OpenPOWER on IntegriCloud