|
19 | 19 | #include "flang/Optimizer/Builder/Todo.h"
|
20 | 20 | #include "flang/Semantics/tools.h"
|
21 | 21 | #include "mlir/Dialect/OpenMP/OpenMPDialect.h"
|
| 22 | +#include <variant> |
22 | 23 |
|
23 | 24 | namespace Fortran {
|
24 | 25 | namespace lower {
|
@@ -397,44 +398,14 @@ void DataSharingProcessor::doPrivatize(
|
397 | 398 |
|
398 | 399 | firOpBuilder.setInsertionPointToEnd(allocEntryBlock);
|
399 | 400 |
|
400 |
| - fir::ExtendedValue localExV = symExV.match( |
401 |
| - [&](const fir::ArrayBoxValue &box) -> fir::ExtendedValue { |
402 |
| - return hlfir::translateToExtendedValue( |
403 |
| - symLoc, firOpBuilder, |
404 |
| - hlfir::Entity{allocRegion.getArgument(0)}, true) |
405 |
| - .first; |
406 |
| - }, |
407 |
| - [&](const fir::CharBoxValue &box) -> fir::ExtendedValue { |
408 |
| - TODO(symLoc, |
409 |
| - "Delayed privatization is not supported for CharBoxValue"); |
410 |
| - return {}; |
411 |
| - }, |
412 |
| - [&](const fir::CharArrayBoxValue &box) -> fir::ExtendedValue { |
413 |
| - TODO( |
414 |
| - symLoc, |
415 |
| - "Delayed privatization is not supported for CharArrayBoxValue"); |
416 |
| - return {}; |
417 |
| - }, |
418 |
| - [&](const fir::ProcBoxValue &box) -> fir::ExtendedValue { |
419 |
| - TODO(symLoc, |
420 |
| - "Delayed privatization is not supported for ProcBoxValue"); |
421 |
| - return {}; |
422 |
| - }, |
423 |
| - [&](const fir::BoxValue &box) -> fir::ExtendedValue { |
424 |
| - TODO(symLoc, "Delayed privatization is not supported for BoxValue"); |
425 |
| - return {}; |
426 |
| - }, |
427 |
| - [&](const fir::PolymorphicValue &box) -> fir::ExtendedValue { |
428 |
| - TODO(symLoc, |
429 |
| - "Delayed privatization is not supported for PolymorphicValue"); |
430 |
| - return {}; |
431 |
| - }, |
432 |
| - [&](const auto &box) -> fir::ExtendedValue { |
433 |
| - return hlfir::translateToExtendedValue( |
434 |
| - symLoc, firOpBuilder, |
435 |
| - hlfir::Entity{allocRegion.getArgument(0)}, true) |
436 |
| - .first; |
437 |
| - }); |
| 401 | + // TODO Delayed privatization has not been tested yet for: CharBoxValue, |
| 402 | + // CharArrayBoxValue, BoxValue, or PolymorphicValue. |
| 403 | + fir::ExtendedValue localExV = |
| 404 | + hlfir::translateToExtendedValue( |
| 405 | + symLoc, firOpBuilder, hlfir::Entity{allocRegion.getArgument(0)}, |
| 406 | + /*contiguousHint=*/ |
| 407 | + std::holds_alternative<fir::ArrayBoxValue>(symExV.matchee())) |
| 408 | + .first; |
438 | 409 |
|
439 | 410 | symTable->addSymbol(*sym, localExV);
|
440 | 411 | symTable->pushScope();
|
|
0 commit comments