Commit d73ffe5
authored
[flang][OpenMP] Introduce variant argument, customize OmpArgument par… (#160372)
…sing
The DECLARE_VARIANT directive takes two names separated by a colon as an
argument: base-name:variant-name. Define OmpBaseVariantNames to
represent this, since no existing argument alternative matches it.
However, there is an issue. The syntax "name1:name2" can be the argument
to DECLARE_VARIANT (if both names are OmpObjects), but it can also be a
reduction-specifier if "name2" is a type. This conflict can only be
resolved once we know what the names are, which is after name resolution
has visited them. The problem is that name resolution has side-effects
that may be (practically) impossible to undo (e.g. creating new symbols,
emitting diagnostic messages).
To avoid this problem this PR makes the parsing of OmpArgument
directive- sensitive: when the directive is DECLARE_VARIANT, don't
attempt to parse a reduction-specifier, consider OmpBaseVariantNames
instead. Otherwise ignore OmpBaseVariantNames in favor of
reduction-specifier.1 parent b7e20c7 commit d73ffe5
File tree
5 files changed
+83
-8
lines changed- flang
- include/flang/Parser
- lib
- Parser
- Semantics
5 files changed
+83
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| 525 | + | |
525 | 526 | | |
526 | 527 | | |
527 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3555 | 3555 | | |
3556 | 3556 | | |
3557 | 3557 | | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
3558 | 3570 | | |
3559 | 3571 | | |
3560 | 3572 | | |
| |||
3584 | 3596 | | |
3585 | 3597 | | |
3586 | 3598 | | |
| 3599 | + | |
3587 | 3600 | | |
3588 | 3601 | | |
3589 | 3602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
322 | 355 | | |
323 | 356 | | |
324 | 357 | | |
325 | | - | |
326 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
327 | 368 | | |
328 | 369 | | |
329 | 370 | | |
| |||
1312 | 1353 | | |
1313 | 1354 | | |
1314 | 1355 | | |
1315 | | - | |
| 1356 | + | |
| 1357 | + | |
1316 | 1358 | | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
1317 | 1369 | | |
1318 | 1370 | | |
1319 | 1371 | | |
1320 | | - | |
| 1372 | + | |
1321 | 1373 | | |
1322 | 1374 | | |
1323 | 1375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2089 | 2089 | | |
2090 | 2090 | | |
2091 | 2091 | | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
2092 | 2097 | | |
2093 | 2098 | | |
2094 | 2099 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1998 | 1998 | | |
1999 | 1999 | | |
2000 | 2000 | | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
2001 | 2005 | | |
2002 | 2006 | | |
2003 | 2007 | | |
| |||
0 commit comments