summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2019-01-16 18:53:05 +0000
committerLeonard Chan <leonardchan@google.com>2019-01-16 18:53:05 +0000
commit86285d2e17ea669fe53853215759c554ad101d31 (patch)
treebbedc37df9ec3971359b80ed5b9c5503f576b213 /clang/lib/AST/ExprConstant.cpp
parent8265e390e740f0fb7464f7c20bd38d55ee145dd4 (diff)
downloadbcm5719-llvm-86285d2e17ea669fe53853215759c554ad101d31.tar.gz
bcm5719-llvm-86285d2e17ea669fe53853215759c554ad101d31.zip
[Fixed Point Arithmetic] Add APFixedPoint to APValue
This adds APFixedPoint to the union of values that can be represented with an APValue. Differential Revision: https://reviews.llvm.org/D56746 llvm-svn: 351368
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r--clang/lib/AST/ExprConstant.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index da093ff22c1..6fced964841 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -2027,6 +2027,9 @@ static bool HandleConversionToBool(const APValue &Val, bool &Result) {
case APValue::Int:
Result = Val.getInt().getBoolValue();
return true;
+ case APValue::FixedPoint:
+ Result = Val.getFixedPoint().getBoolValue();
+ return true;
case APValue::Float:
Result = !Val.getFloat().isZero();
return true;
OpenPOWER on IntegriCloud