[PATCH] D53178: merge two near-identical functions createPrivateGlobalForString into one
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 11 15:58:50 PDT 2018
vitalybuka accepted this revision.
vitalybuka added inline comments.
This revision is now accepted and ready to land.
================
Comment at: lib/Transforms/Instrumentation/Instrumentation.cpp:62
+ Constant *StrConst = ConstantDataArray::getString(M.getContext(), Str);
+ // We use private linkage for module-local strings. If they can be merged
+ // with another one, we set the unnamed_addr attribute.
----------------
```
if (AllowMerging)
GV->setUnnamedAddr(GlobalValue::UnnamedAddr::Global);
GV->setAlignment(1); // Strings may not be merged w/o setting align 1.
```
Repository:
rL LLVM
https://reviews.llvm.org/D53178
More information about the llvm-commits
mailing list