aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorJean Perier <jperier@nvidia.com>2023-05-09 18:22:55 +0200
committerJean Perier <jperier@nvidia.com>2023-05-09 18:26:21 +0200
commitb9031d327929c160293f38b0afbf7facec0f591c (patch)
treeaf1f6b6cab13f56e018b0f1615f68d39917d1e59 /clang/lib/Lex/ModuleMap.cpp
parent9dec07f44a0615ace09aabc19544d4eed0eff2c4 (diff)
downloadllvm-b9031d327929c160293f38b0afbf7facec0f591c.zip
llvm-b9031d327929c160293f38b0afbf7facec0f591c.tar.gz
llvm-b9031d327929c160293f38b0afbf7facec0f591c.tar.bz2
[flang] Ensure pointer components are always established
Follow up of https://reviews.llvm.org/D149979 for lowering. In Fortran, it is possible to assign a pointer to another pointer with an undefined association status. When using the runtime do to none trivial pointer association, if the descriptor are garbage, the runtime cannot safely detect that it has a garbage descriptor, and it cannot safely know the descriptor size leading to undefined behavior. Another reason to initialize descriptor of pointers is to record any non deferred length parameter value. Hence, although this is not required by Fortran, f18 always initialize pointers to NULL(). This was already done in lowering for whole pointer object, but not for pointer components. This patch uses the related semantics patch that updated derivedTypeSpe::HasDefaultInitialization to ensure pointer components of local and global object are always initialized. It adds tests to ensure that allocation of such derived type uses the runtime to ensure the storage is initialized, and that structure constructors are setting the descriptor component to NULL() if no initial target is given. Differential Revision: https://reviews.llvm.org/D150180
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions