summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/AnalysisBasedWarnings.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-11-30 21:26:09 +0000
committerFangrui Song <maskray@google.com>2018-11-30 21:26:09 +0000
commitf5d3335d75dfe13b1263bbc305514ccfbc25417d (patch)
tree109c58b9f8af11bcec6b2b974867c9f7d07729af /clang/lib/Sema/AnalysisBasedWarnings.cpp
parentd1a4b06c208c177a4a86c4c8ec994ca4fd44870e (diff)
downloadbcm5719-llvm-f5d3335d75dfe13b1263bbc305514ccfbc25417d.tar.gz
bcm5719-llvm-f5d3335d75dfe13b1263bbc305514ccfbc25417d.zip
Revert r347417 "Re-Reinstate 347294 with a fix for the failures."
Kept the "indirect_builtin_constant_p" test case in test/SemaCXX/constant-expression-cxx1y.cpp while we are investigating why the following snippet fails: extern char extern_var; struct { int a; } a = {__builtin_constant_p(extern_var)}; llvm-svn: 348039
Diffstat (limited to 'clang/lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r--clang/lib/Sema/AnalysisBasedWarnings.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index 3b6cbe9469b..ab46554485f 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -1309,10 +1309,11 @@ static bool isInLoop(const ASTContext &Ctx, const ParentMap &PM,
case Stmt::ObjCForCollectionStmtClass:
return true;
case Stmt::DoStmtClass: {
- Expr::EvalResult Result;
- if (!cast<DoStmt>(S)->getCond()->EvaluateAsInt(Result, Ctx))
+ const Expr *Cond = cast<DoStmt>(S)->getCond();
+ llvm::APSInt Val;
+ if (!Cond->EvaluateAsInt(Val, Ctx))
return true;
- return Result.Val.getInt().getBoolValue();
+ return Val.getBoolValue();
}
default:
break;
OpenPOWER on IntegriCloud