diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-01-21 12:35:58 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-01-21 12:35:58 +0000 |
commit | 8524d1595425818a7aac74a8bbd36b20d6e46029 (patch) | |
tree | b6a68a5d078f1244023b11d190dcefaeda305ef0 /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | ff262fa8071f5680c794ec5bc2074ebec3eebce7 (diff) | |
download | bcm5719-llvm-8524d1595425818a7aac74a8bbd36b20d6e46029.tar.gz bcm5719-llvm-8524d1595425818a7aac74a8bbd36b20d6e46029.zip |
[OPENMP] Fix crash on reduction for complex variables.
reworked codegen for reduction operation for complex types to avoid crash
llvm-svn: 258394
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 1507f84aeee..38f3d57e00e 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -2167,17 +2167,17 @@ static void emitSimpleAtomicStore(CodeGenFunction &CGF, bool IsSeqCst, } } -static void emitSimpleStore(CodeGenFunction &CGF, LValue LVal, RValue RVal, - QualType RValTy, SourceLocation Loc) { - switch (CGF.getEvaluationKind(LVal.getType())) { +void CodeGenFunction::emitOMPSimpleStore(LValue LVal, RValue RVal, + QualType RValTy, SourceLocation Loc) { + switch (getEvaluationKind(LVal.getType())) { case TEK_Scalar: - CGF.EmitStoreThroughLValue(RValue::get(convertToScalarValue( - CGF, RVal, RValTy, LVal.getType(), Loc)), - LVal); + EmitStoreThroughLValue(RValue::get(convertToScalarValue( + *this, RVal, RValTy, LVal.getType(), Loc)), + LVal); break; case TEK_Complex: - CGF.EmitStoreOfComplex( - convertToComplexValue(CGF, RVal, RValTy, LVal.getType(), Loc), LVal, + EmitStoreOfComplex( + convertToComplexValue(*this, RVal, RValTy, LVal.getType(), Loc), LVal, /*isInit=*/false); break; case TEK_Aggregate: @@ -2205,7 +2205,7 @@ static void EmitOMPAtomicReadExpr(CodeGenFunction &CGF, bool IsSeqCst, // list. if (IsSeqCst) CGF.CGM.getOpenMPRuntime().emitFlush(CGF, llvm::None, Loc); - emitSimpleStore(CGF, VLValue, Res, X->getType().getNonReferenceType(), Loc); + CGF.emitOMPSimpleStore(VLValue, Res, X->getType().getNonReferenceType(), Loc); } static void EmitOMPAtomicWriteExpr(CodeGenFunction &CGF, bool IsSeqCst, @@ -2463,7 +2463,7 @@ static void EmitOMPAtomicCaptureExpr(CodeGenFunction &CGF, bool IsSeqCst, } } // Emit post-update store to 'v' of old/new 'x' value. - emitSimpleStore(CGF, VLValue, NewVVal, NewVValType, Loc); + CGF.emitOMPSimpleStore(VLValue, NewVVal, NewVValType, Loc); // OpenMP, 2.12.6, atomic Construct // Any atomic construct with a seq_cst clause forces the atomically // performed operation to include an implicit flush operation without a |