summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFG.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-08-24 21:39:56 +0000
committerDouglas Gregor <dgregor@apple.com>2009-08-24 21:39:56 +0000
commit4c95288f649dc553809a4b490477e9a7dda8015f (patch)
tree04fa71e2f63ecff8fc9a676a7cd402969970744d /clang/lib/Analysis/CFG.cpp
parentd5ab926848b377ee416cc227e9418befb2f47d85 (diff)
downloadbcm5719-llvm-4c95288f649dc553809a4b490477e9a7dda8015f.tar.gz
bcm5719-llvm-4c95288f649dc553809a4b490477e9a7dda8015f.zip
Don't try to evaluate an expression that is type- or value-dependent while building the CFG
llvm-svn: 79941
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r--clang/lib/Analysis/CFG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 08a13c4d8ed..3677f7ee0d5 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -158,7 +158,8 @@ private:
/// if we can evaluate to a known value, otherwise return -1.
TryResult TryEvaluateBool(Expr *S) {
Expr::EvalResult Result;
- if (S->Evaluate(Result, *Context) && Result.Val.isInt())
+ if (!S->isTypeDependent() && !S->isValueDependent() &&
+ S->Evaluate(Result, *Context) && Result.Val.isInt())
return Result.Val.getInt().getBoolValue();
return TryResult();
OpenPOWER on IntegriCloud