diff options
author | Tom Eccles <tom.eccles@arm.com> | 2025-05-07 10:18:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-07 10:18:13 +0100 |
commit | 75e5643abf6b59db8dfae6b524e9c3c2ec0ffc29 (patch) | |
tree | 3cd8d57acc07f3d8e0658299bb104ae7a106060d /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 18c5ad5c6c178365d270439742863e14c8981ea3 (diff) | |
download | llvm-75e5643abf6b59db8dfae6b524e9c3c2ec0ffc29.zip llvm-75e5643abf6b59db8dfae6b524e9c3c2ec0ffc29.tar.gz llvm-75e5643abf6b59db8dfae6b524e9c3c2ec0ffc29.tar.bz2 |
[flang][OpenMP] share global variable initialization code (#138672)
Fixes #108136
In #108136 (the new testcase), flang was missing the length parameter
required for the variable length string when boxing the global variable.
The code that is initializing global variables for OpenMP did not
support types with length parameters.
Instead of duplicating this initialization logic in OpenMP, I decided to
use the exact same initialization as is used in the base language
because this will already be well tested and will be updated for any new
types. The difference for OpenMP is that the global variables will be
zero initialized instead of left undefined.
Previously `Fortran::lower::createGlobalInitialization` was used to
share a smaller amount of the logic with the base language lowering. I
think this bug has demonstrated that helper was too low level to be
helpful, and it was only used in OpenMP so I have made it static inside
of ConvertVariable.cpp.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions