Skip to content

Commit f4f69e1

Browse files
author
Boris Kosmynin
committed
fix int. issue llvm#55
1 parent ef4f108 commit f4f69e1

File tree

1 file changed

+43
-6
lines changed

1 file changed

+43
-6
lines changed

clang/tools/sotoc/src/OmpPragma.cpp

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ bool OmpPragma::isClausePrintable(clang::OMPClause *Clause) {
119119
case clang::OpenMPDirectiveKind::OMPD_target_parallel: {
120120
switch (Clause->getClauseKind()) {
121121
// case clang::OpenMPClauseKind::OMPC_map:
122-
case clang::OpenMPClauseKind::OMPC_if:
123122
case clang::OpenMPClauseKind::OMPC_num_threads:
124123
case clang::OpenMPClauseKind::OMPC_default:
125124
case clang::OpenMPClauseKind::OMPC_proc_bind:
@@ -130,12 +129,18 @@ bool OmpPragma::isClausePrintable(clang::OMPClause *Clause) {
130129
return true;
131130
default:
132131
return false;
132+
case clang::OpenMPClauseKind::OMPC_if:
133+
clang::OMPIfClause* IC = llvm::dyn_cast_or_null<clang::OMPIfClause>(Clause);
134+
if ((IC->getNameModifier()) == clang::OpenMPDirectiveKind::OMPD_target) {
135+
return false;
136+
} else {
137+
return true;
138+
}
133139
}
134140
}
135141
case clang::OpenMPDirectiveKind::OMPD_target_parallel_for: {
136142
switch (Clause->getClauseKind()) {
137143
// case clang::OpenMPClauseKind::OMPC_map:
138-
case clang::OpenMPClauseKind::OMPC_if:
139144
case clang::OpenMPClauseKind::OMPC_num_threads:
140145
case clang::OpenMPClauseKind::OMPC_default:
141146
case clang::OpenMPClauseKind::OMPC_proc_bind:
@@ -151,12 +156,18 @@ bool OmpPragma::isClausePrintable(clang::OMPClause *Clause) {
151156
return true;
152157
default:
153158
return false;
159+
case clang::OpenMPClauseKind::OMPC_if:
160+
clang::OMPIfClause* IC = llvm::dyn_cast_or_null<clang::OMPIfClause>(Clause);
161+
if ((IC->getNameModifier()) == clang::OpenMPDirectiveKind::OMPD_target) {
162+
return false;
163+
} else {
164+
return true;
165+
}
154166
}
155167
}
156168
case clang::OpenMPDirectiveKind::OMPD_target_parallel_for_simd: {
157169
switch (Clause->getClauseKind()) {
158170
// case clang::OpenMPClauseKind::OMPC_map:
159-
case clang::OpenMPClauseKind::OMPC_if:
160171
case clang::OpenMPClauseKind::OMPC_num_threads:
161172
case clang::OpenMPClauseKind::OMPC_default:
162173
case clang::OpenMPClauseKind::OMPC_proc_bind:
@@ -175,6 +186,13 @@ bool OmpPragma::isClausePrintable(clang::OMPClause *Clause) {
175186
return true;
176187
default:
177188
return false;
189+
case clang::OpenMPClauseKind::OMPC_if:
190+
clang::OMPIfClause* IC = llvm::dyn_cast_or_null<clang::OMPIfClause>(Clause);
191+
if ((IC->getNameModifier()) == clang::OpenMPDirectiveKind::OMPD_target) {
192+
return false;
193+
} else {
194+
return true;
195+
}
178196
}
179197
}
180198
case clang::OpenMPDirectiveKind::OMPD_target_simd: {
@@ -218,7 +236,6 @@ bool OmpPragma::isClausePrintable(clang::OMPClause *Clause) {
218236
case clang::OpenMPClauseKind::OMPC_lastprivate:
219237
case clang::OpenMPClauseKind::OMPC_collapse:
220238
case clang::OpenMPClauseKind::OMPC_dist_schedule:
221-
case clang::OpenMPClauseKind::OMPC_if:
222239
case clang::OpenMPClauseKind::OMPC_num_threads:
223240
case clang::OpenMPClauseKind::OMPC_default:
224241
case clang::OpenMPClauseKind::OMPC_proc_bind:
@@ -230,7 +247,14 @@ bool OmpPragma::isClausePrintable(clang::OMPClause *Clause) {
230247
return true;
231248
default:
232249
return false;
233-
}
250+
case clang::OpenMPClauseKind::OMPC_if:
251+
clang::OMPIfClause* IC = llvm::dyn_cast_or_null<clang::OMPIfClause>(Clause);
252+
if ((IC->getNameModifier()) == clang::OpenMPDirectiveKind::OMPD_target) {
253+
return false;
254+
} else {
255+
return true;
256+
}
257+
}
234258
}
235259
case clang::OpenMPDirectiveKind::OMPD_teams_distribute_parallel_for_simd:
236260
case clang::OpenMPDirectiveKind::
@@ -241,7 +265,6 @@ bool OmpPragma::isClausePrintable(clang::OMPClause *Clause) {
241265
case clang::OpenMPClauseKind::OMPC_lastprivate:
242266
case clang::OpenMPClauseKind::OMPC_collapse:
243267
case clang::OpenMPClauseKind::OMPC_dist_schedule:
244-
case clang::OpenMPClauseKind::OMPC_if:
245268
case clang::OpenMPClauseKind::OMPC_num_threads:
246269
case clang::OpenMPClauseKind::OMPC_default:
247270
case clang::OpenMPClauseKind::OMPC_proc_bind:
@@ -257,6 +280,13 @@ bool OmpPragma::isClausePrintable(clang::OMPClause *Clause) {
257280
return true;
258281
default:
259282
return false;
283+
case clang::OpenMPClauseKind::OMPC_if:
284+
clang::OMPIfClause* IC = llvm::dyn_cast_or_null<clang::OMPIfClause>(Clause);
285+
if ((IC->getNameModifier()) == clang::OpenMPDirectiveKind::OMPD_target) {
286+
return false;
287+
} else {
288+
return true;
289+
}
260290
}
261291
}
262292
case clang::OpenMPDirectiveKind::OMPD_teams_distribute_simd:
@@ -279,6 +309,13 @@ bool OmpPragma::isClausePrintable(clang::OMPClause *Clause) {
279309
return true;
280310
default:
281311
return false;
312+
case clang::OpenMPClauseKind::OMPC_if:
313+
clang::OMPIfClause* IC = llvm::dyn_cast_or_null<clang::OMPIfClause>(Clause);
314+
if ((IC->getNameModifier()) == clang::OpenMPDirectiveKind::OMPD_target) {
315+
return false;
316+
} else {
317+
return true;
318+
}
282319
}
283320
}
284321
default:

0 commit comments

Comments
 (0)