aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorJean Perier <jperier@nvidia.com>2022-02-09 09:28:27 +0100
committerJean Perier <jperier@nvidia.com>2022-02-09 09:30:32 +0100
commit47995a0ec92643f8b799c19103ed2c9222e63221 (patch)
tree5089244d7d2f451b6ffec3d8ab263a89842daf42 /llvm/unittests/Support/CommandLineTest.cpp
parentb63ca0a0681fa3f1c4ec21d195667dcf36adbb22 (diff)
downloadllvm-47995a0ec92643f8b799c19103ed2c9222e63221.zip
llvm-47995a0ec92643f8b799c19103ed2c9222e63221.tar.gz
llvm-47995a0ec92643f8b799c19103ed2c9222e63221.tar.bz2
[flang] catch implicit interface incompatibility with global scope symbol
Previously, when calling a procedure implicitly for which a global scope procedure symbol with the same name existed, semantics resolved the procedure name in the call to the global symbol without checking that the symbol interface was compatible with the implicit interface of the call. This could cause expression rewrite and lowering to later badly process the implicit call assuming a different result type or an explicit interface. This could lead to lowering crash in case the actual argument were incompatible with the dummies from the explicit interface. Emit errors in the following problematic cases: - If the result type from the symbol did not match the one from the implicit interface. - If the symbol requires an explicit interface. This patch still allows calling an F77 like procedure with different actual argument types than the one it was defined with because it is correctly supported in lowering and is a feature in some program (it is a pointer cast). The two cases that won't be accepted have little chance to make much sense. Results returning ABIs may differ depending on the return types, and function that requires explicit interface usually requires descriptors or specific processing that is incompatible with implicit interfaces. Note that this patch is not making a deep analysis, and it will only catch mistakes if a global symbol and an implicit interface are involved. Cases where the user provided a conflicting explicit interface would still require a pass after name resolution to study conflicts more deeply. But these cases will not crash lowering or trigger expression rewrite to do weird things. Differential Revision: https://reviews.llvm.org/D119274
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions