diff options
author | Bill Wendling <isanbard@gmail.com> | 2018-11-20 23:24:16 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2018-11-20 23:24:16 +0000 |
commit | 91549ed15f97f21de8770196e66da3d228820cdc (patch) | |
tree | a4a3c5ffe121d9c0fdcce151e96eba612d3c7ded /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | 8eb65cb25e67a2b426b94152f9c9bb3c1025b701 (diff) | |
download | bcm5719-llvm-91549ed15f97f21de8770196e66da3d228820cdc.tar.gz bcm5719-llvm-91549ed15f97f21de8770196e66da3d228820cdc.zip |
Reinstate 347294 with a fix for the failures.
EvaluateAsInt() is sometimes called in a constant context. When that's the
case, we need to specify it as so.
llvm-svn: 347364
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 9113b67684a..c92338a497d 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -2321,9 +2321,11 @@ bool CodeGenFunction::EmitOMPWorksharingLoop( Chunk = EmitScalarConversion(Chunk, ChunkExpr->getType(), S.getIterationVariable()->getType(), S.getBeginLoc()); - llvm::APSInt EvaluatedChunk; - if (ChunkExpr->EvaluateAsInt(EvaluatedChunk, getContext())) + Expr::EvalResult Result; + if (ChunkExpr->EvaluateAsInt(Result, getContext())) { + llvm::APSInt EvaluatedChunk = Result.Val.getInt(); HasChunkSizeOne = (EvaluatedChunk.getLimitedValue() == 1); + } } const unsigned IVSize = getContext().getTypeSize(IVExpr->getType()); const bool IVSigned = IVExpr->getType()->hasSignedIntegerRepresentation(); |