@@ -137,14 +137,15 @@ void TargetCode::generateFunctionPrologue(TargetCodeRegion *TCR,
137
137
Out << " void *__sotoc_var_" ;
138
138
nDim.push_back (dim); // push total number of dimensions
139
139
} else {
140
- DEBUGP (" Generating code for non-array type" );
141
140
Out << (*i)->getType ().getAsString () << " " ;
142
141
if (!(*i)->getType ().getTypePtr ()->isPointerType ()) {
143
142
if (C) {
144
143
// Parameters which are not first private (e.g., explicit mapped vars)
145
144
// are passed by reference, all others by value.
146
- if (!(C->getClauseKind () ==
147
- clang::OpenMPClauseKind::OMPC_firstprivate)) {
145
+ if (C->getClauseKind () !=
146
+ clang::OpenMPClauseKind::OMPC_firstprivate &&
147
+ C->getClauseKind () !=
148
+ clang::OpenMPClauseKind::OMPC_private) {
148
149
Out << " *__sotoc_var_" ;
149
150
}
150
151
}
@@ -192,8 +193,10 @@ void TargetCode::generateFunctionPrologue(TargetCodeRegion *TCR,
192
193
if (C) {
193
194
// Parameters which are not first private (e.g., explicit mapped vars)
194
195
// are passed by reference, all others by value.
195
- if (!(C->getClauseKind () ==
196
- clang::OpenMPClauseKind::OMPC_firstprivate)) {
196
+ if (C->getClauseKind () !=
197
+ clang::OpenMPClauseKind::OMPC_firstprivate &&
198
+ C->getClauseKind () !=
199
+ clang::OpenMPClauseKind::OMPC_private) {
197
200
auto VarName = (*I)->getDeclName ().getAsString ();
198
201
Out << " " << (*I)->getType ().getAsString () << " " << VarName
199
202
<< " = "
@@ -242,8 +245,10 @@ void TargetCode::generateFunctionEpilogue(TargetCodeRegion *TCR,
242
245
if (C) {
243
246
// Parameters which are not first private (e.g., explicit mapped vars)
244
247
// are passed by reference, all others by value.
245
- if (!(C->getClauseKind () ==
246
- clang::OpenMPClauseKind::OMPC_firstprivate)) {
248
+ if (C->getClauseKind () !=
249
+ clang::OpenMPClauseKind::OMPC_firstprivate &&
250
+ C->getClauseKind () !=
251
+ clang::OpenMPClauseKind::OMPC_private) {
247
252
auto VarName = (*I)->getDeclName ().getAsString ();
248
253
Out << " \n *__sotoc_var_" << VarName << " = " << VarName << " ;" ;
249
254
}
0 commit comments