File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,11 @@ class ProcedureRef {
248248 ProcedureRef (ProcedureDesignator &&p, ActualArguments &&a,
249249 bool hasAlternateReturns = false )
250250 : proc_{std::move (p)}, arguments_{std::move (a)},
251- hasAlternateReturns_{hasAlternateReturns} {}
251+ hasAlternateReturns_{hasAlternateReturns} {
252+ // Gathers necessary information to determine the need for copy-in and
253+ // copy-out
254+ DetermineCopyInOut ();
255+ }
252256 ~ProcedureRef ();
253257 static void Deleter (ProcedureRef *);
254258
@@ -285,9 +289,9 @@ class ProcedureRef {
285289 bool operator ==(const ProcedureRef &) const ;
286290 llvm::raw_ostream &AsFortran (llvm::raw_ostream &) const ;
287291
292+ protected:
288293 void DetermineCopyInOut ();
289294
290- protected:
291295 ProcedureDesignator proc_;
292296 ActualArguments arguments_;
293297 Chevrons chevrons_;
Original file line number Diff line number Diff line change @@ -284,9 +284,6 @@ class CallerInterface : public CallInterface<CallerInterface> {
284284 CallerInterface (const Fortran::evaluate::ProcedureRef &p,
285285 Fortran::lower::AbstractConverter &c)
286286 : CallInterface{c}, procRef{p} {
287- // Ensure that procRef gathers necessary information to determine the
288- // need for copy-in and copy-out
289- const_cast <Fortran::evaluate::ProcedureRef &>(procRef).DetermineCopyInOut ();
290287 declare ();
291288 mapPassedEntities ();
292289 actualInputs.resize (getNumFIRArguments ());
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ void ProcedureRef::DetermineCopyInOut() {
255255 // Get folding context of the call site owner
256256 FoldingContext &fc{proc_.GetSymbol ()->owner ().context ().foldingContext ()};
257257 auto procInfo{characteristics::Procedure::Characterize (
258- proc () , fc, /* emitError=*/ false )};
258+ proc_ , fc, /* emitError=*/ true )};
259259 if (!procInfo) {
260260 return ;
261261 }
You can’t perform that action at this time.
0 commit comments