aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/StringRef.cpp
diff options
context:
space:
mode:
authorSlava Zakharin <szakharin@nvidia.com>2023-05-09 19:50:48 -0700
committerSlava Zakharin <szakharin@nvidia.com>2023-05-12 13:40:22 -0700
commitbe5747e516937df6436c9abb8059b6e471c02226 (patch)
tree1b59c7633122272cf02352ac0e75c20c9a8305e4 /llvm/lib/Support/StringRef.cpp
parent26a7f42306134dca659f19ca5d7bdb4fe23340f2 (diff)
downloadllvm-be5747e516937df6436c9abb8059b6e471c02226.zip
llvm-be5747e516937df6436c9abb8059b6e471c02226.tar.gz
llvm-be5747e516937df6436c9abb8059b6e471c02226.tar.bz2
[flang] Fixed global name creation for literal constants.
The global names were created using a hash based on the address of std::vector::data address. Since the memory may be reused by different std::vector's, this may cause non-equivalent constant expressions to map to the same name. This is what is happening in the modified flang/test/Lower/constant-literal-mangling.f90 test. I changed the name creation to use a map between the constant expressions and corresponding unique names. The uniquing is done using a name counter in FirConverter. The effect of this change is that the equivalent constant expressions are now mapped to the same global, and the naming is "stable" (i.e. it does not change from compilation to compilation). Though, the issue is not HLFIR specific it was affecting several tests when using HLFIR lowering. Differential Revision: https://reviews.llvm.org/D150380
Diffstat (limited to 'llvm/lib/Support/StringRef.cpp')
0 files changed, 0 insertions, 0 deletions