aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object
diff options
context:
space:
mode:
authorJean Perier <jperier@nvidia.com>2023-02-10 08:56:53 +0100
committerJean Perier <jperier@nvidia.com>2023-02-10 08:57:06 +0100
commit92e904b9ce2d3319bccf56f05179ee5b5a424f0a (patch)
tree5e663a09a3f1ef81b238f5d2bd48a2559f17b8f1 /llvm/lib/Object
parentfc2c791e89cd10ab9225421f215c2267e832977f (diff)
downloadllvm-92e904b9ce2d3319bccf56f05179ee5b5a424f0a.zip
llvm-92e904b9ce2d3319bccf56f05179ee5b5a424f0a.tar.gz
llvm-92e904b9ce2d3319bccf56f05179ee5b5a424f0a.tar.bz2
[flang][hlfir] Ramp-up support of implicit interface mismatches
There is a lot of Fortran code that takes advantage of F77 implicit interface to pass arguments with a different type than those from the subprogram definition (which is well defined if the storage and passing convention are the same or compatible). When the definition and calls are in different files, there is nothing special to do: the actual arguments are already used to compute the call interface. The trouble for lowering comes when the definition is in the same compilation unit (Semantics raises warning). Then, lowering will be provided with the interface from the definition to prepare the argument, and this leads to many ad-hoc handling (see builder.convertWithSemantics) in the current lowering to cope with the dummy/actual mismatches on a case by case basis. The current lowering to FIR is not even complete for all mismatch cases that can be found in the wild (see https://github.com/llvm/llvm-project/issues/60550), it is crashing or hitting asserts for many of the added tests. For HLFIR, instead of coping on a case by case basis, the call interface will be recomputed according to the actual arguments when calling an external procedure that can be called with an explicit interface. One extra case still has to be handled manually because it may happen in calls with explicit interfaces: passing a character procedure designator to a non character procedure dummy (and vice-versa) is widely accepted even with explicit interfaces (and flang semantic accepts it). Yet, this "mismatch" cannot be dealt with a simple fir.convert because character dummy procedure are passed with a different passing convention: an extra argument is hoisted for the result length (in FIR, there is no extra argument yet, but the MLIR func argument is a tuple<fir.boxproc, len>). Differential Revision: https://reviews.llvm.org/D143636
Diffstat (limited to 'llvm/lib/Object')
0 files changed, 0 insertions, 0 deletions