Skip to content

Commit 68a2010

Browse files
committed
[Flang] Add a couple of TODOs for unsupported procedure pointer usages.
1 parent c43dbb6 commit 68a2010

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

flang/lib/Lower/ConvertCall.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,8 @@ genIntrinsicRefCore(Fortran::lower::PreparedActualArguments &loweredActuals,
15321532
}
15331533

15341534
hlfir::Entity actual = arg.value()->getActual(loc, builder);
1535+
if (actual.isProcedurePointer())
1536+
TODO(loc, "Procedure pointer as actual argument to intrinsics.");
15351537
switch (argRules.lowerAs) {
15361538
case fir::LowerIntrinsicArgAs::Value:
15371539
operands.emplace_back(

flang/lib/Lower/ConvertProcedureDesignator.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "flang/Lower/SymbolMap.h"
1818
#include "flang/Optimizer/Builder/Character.h"
1919
#include "flang/Optimizer/Builder/IntrinsicCall.h"
20+
#include "flang/Optimizer/Builder/Todo.h"
2021
#include "flang/Optimizer/Dialect/FIROps.h"
2122

2223
static bool areAllSymbolsInExprMapped(const Fortran::evaluate::ExtentExpr &expr,
@@ -100,10 +101,13 @@ hlfir::EntityWithAttributes Fortran::lower::convertProcedureDesignatorToHLFIR(
100101
const Fortran::evaluate::ProcedureDesignator &proc,
101102
Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) {
102103
const auto *sym = proc.GetSymbol();
103-
if (sym)
104+
if (sym) {
105+
if (sym->GetUltimate().attrs().test(Fortran::semantics::Attr::INTRINSIC))
106+
TODO(loc, "Procedure pointer with intrinsic target.");
104107
if (std::optional<fir::FortranVariableOpInterface> varDef =
105108
symMap.lookupVariableDefinition(*sym))
106109
return *varDef;
110+
}
107111

108112
fir::ExtendedValue procExv =
109113
convertProcedureDesignator(loc, converter, proc, symMap, stmtCtx);

0 commit comments

Comments
 (0)