summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2018-11-21 12:47:43 +0000
committerNico Weber <nicolasweber@gmx.de>2018-11-21 12:47:43 +0000
commit9f0246d47390775ec3bf2c2b7e4ded3d26193468 (patch)
treeb04d1324ec67a7b17d8824779c13deb94dac2812 /clang/lib/CodeGen/CGOpenMPRuntime.cpp
parent4923930be5367488be818168916ad94dc878bb59 (diff)
downloadbcm5719-llvm-9f0246d47390775ec3bf2c2b7e4ded3d26193468.tar.gz
bcm5719-llvm-9f0246d47390775ec3bf2c2b7e4ded3d26193468.zip
Revert r347364 again, the fix was incomplete.
llvm-svn: 347389
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index cf2c6cf6f22..831412bce61 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -6795,11 +6795,10 @@ private:
}
// Check if the length evaluates to 1.
- Expr::EvalResult Result;
- if (!Length->EvaluateAsInt(Result, CGF.getContext()))
+ llvm::APSInt ConstLength;
+ if (!Length->EvaluateAsInt(ConstLength, CGF.getContext()))
return true; // Can have more that size 1.
- llvm::APSInt ConstLength = Result.Val.getInt();
return ConstLength.getSExtValue() != 1;
}
@@ -9163,8 +9162,8 @@ void CGOpenMPRuntime::emitDeclareSimdFunction(const FunctionDecl *FD,
ParamAttrTy &ParamAttr = ParamAttrs[Pos];
ParamAttr.Kind = Linear;
if (*SI) {
- Expr::EvalResult Result;
- if (!(*SI)->EvaluateAsInt(Result, C, Expr::SE_AllowSideEffects)) {
+ if (!(*SI)->EvaluateAsInt(ParamAttr.StrideOrArg, C,
+ Expr::SE_AllowSideEffects)) {
if (const auto *DRE =
cast<DeclRefExpr>((*SI)->IgnoreParenImpCasts())) {
if (const auto *StridePVD = cast<ParmVarDecl>(DRE->getDecl())) {
@@ -9173,8 +9172,6 @@ void CGOpenMPRuntime::emitDeclareSimdFunction(const FunctionDecl *FD,
ParamPositions[StridePVD->getCanonicalDecl()]);
}
}
- } else {
- ParamAttr.StrideOrArg = Result.Val.getInt();
}
}
++SI;
OpenPOWER on IntegriCloud