summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-05-21 09:47:46 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-05-21 09:47:46 +0000
commit5129d3a4f58c7514a31d49da5c7c70c17aaa9a8f (patch)
tree949ba9c1c89f75d50cc59e708639b8a4db3e0a74 /clang/lib/CodeGen
parent2db1a03b07ce4d22ad32ebbecdc2099b0e67524e (diff)
downloadbcm5719-llvm-5129d3a4f58c7514a31d49da5c7c70c17aaa9a8f.tar.gz
bcm5719-llvm-5129d3a4f58c7514a31d49da5c7c70c17aaa9a8f.zip
[OPENMP] Fixed codegen for parameters privatization.
For parameters we shall take a derived type of parameters, not the original one. llvm-svn: 237882
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp9
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp9
2 files changed, 0 insertions, 18 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index a8665254545..789302c8855 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -1289,9 +1289,6 @@ static llvm::Value *emitCopyprivateCopyFunction(
CGF.ConvertTypeForMem(C.getPointerType(SrcExprs[I]->getType())));
auto *VD = cast<DeclRefExpr>(CopyprivateVars[I])->getDecl();
QualType Type = VD->getType();
- if (auto *PVD = dyn_cast<ParmVarDecl>(VD)) {
- Type = PVD->getOriginalType();
- }
CGF.EmitOMPCopy(CGF, Type, DestAddr, SrcAddr,
cast<VarDecl>(cast<DeclRefExpr>(DestExprs[I])->getDecl()),
cast<VarDecl>(cast<DeclRefExpr>(SrcExprs[I])->getDecl()),
@@ -1671,9 +1668,6 @@ createPrivatesRecordDecl(CodeGenModule &CGM,
RD->startDefinition();
for (auto &&Pair : Privates) {
auto Type = Pair.second.Original->getType();
- if (auto *PVD = dyn_cast<ParmVarDecl>(Pair.second.Original)) {
- Type = PVD->getOriginalType();
- }
Type = Type.getNonReferenceType();
addFieldToRecordDecl(C, RD, Type);
}
@@ -1960,9 +1954,6 @@ void CGOpenMPRuntime::emitTaskCall(
auto SharedRefLValue =
CGF.EmitLValueForField(SharedsBase, SharedField);
QualType Type = OriginalVD->getType();
- if (auto *PVD = dyn_cast<ParmVarDecl>(OriginalVD)) {
- Type = PVD->getOriginalType();
- }
if (Type->isArrayType()) {
// Initialize firstprivate array.
if (!isa<CXXConstructExpr>(Init) ||
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 4a4c06f7e1c..78412e47345 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -133,9 +133,6 @@ bool CodeGenFunction::EmitOMPFirstprivateClause(const OMPExecutableDirective &D,
(*IRef)->getType(), VK_LValue, (*IRef)->getExprLoc());
auto *OriginalAddr = EmitLValue(&DRE).getAddress();
QualType Type = OrigVD->getType();
- if (auto *PVD = dyn_cast<ParmVarDecl>(OrigVD)) {
- Type = PVD->getOriginalType();
- }
if (Type->isArrayType()) {
// Emit VarDecl with copy init for arrays.
// Get the address of the original variable captured in current
@@ -229,9 +226,6 @@ bool CodeGenFunction::EmitOMPCopyinClause(const OMPExecutableDirective &D) {
for (auto *AssignOp : C->assignment_ops()) {
auto *VD = cast<VarDecl>(cast<DeclRefExpr>(*IRef)->getDecl());
QualType Type = VD->getType();
- if (auto *PVD = dyn_cast<ParmVarDecl>(VD)) {
- Type = PVD->getOriginalType();
- }
if (CopiedVars.insert(VD->getCanonicalDecl()).second) {
// Get the address of the master variable.
auto *MasterAddr = VD->isStaticLocal()
@@ -355,9 +349,6 @@ void CodeGenFunction::EmitOMPLastprivateClauseFinal(
for (auto *AssignOp : C->assignment_ops()) {
auto *PrivateVD = cast<VarDecl>(cast<DeclRefExpr>(*IRef)->getDecl());
QualType Type = PrivateVD->getType();
- if (auto *PVD = dyn_cast<ParmVarDecl>(PrivateVD)) {
- Type = PVD->getOriginalType();
- }
auto *CanonicalVD = PrivateVD->getCanonicalDecl();
if (AlreadyEmittedVars.insert(CanonicalVD).second) {
// If lastprivate variable is a loop control variable for loop-based
OpenPOWER on IntegriCloud