summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2018-12-04 00:36:14 +0000
committerVitaly Buka <vitalybuka@google.com>2018-12-04 00:36:14 +0000
commit537cfc0352164588b9105171e17197515243b5f2 (patch)
tree6980e1d53dd0e4328a0e859d67d55b68288b6a22 /llvm/lib/Transforms
parentbce2086ad15417a2bfbcafd33464bc9452da1b77 (diff)
downloadbcm5719-llvm-537cfc0352164588b9105171e17197515243b5f2.tar.gz
bcm5719-llvm-537cfc0352164588b9105171e17197515243b5f2.zip
[asan] Reduce binary size by using unnamed private aliases
Summary: --asan-use-private-alias increases binary sizes by 10% or more. Most of this space was long names of aliases and new symbols. These symbols are not needed for the ODC check at all. Reviewers: eugenis Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D55146 llvm-svn: 348221
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 42b8179f800..1cbdf4a92c8 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -746,7 +746,7 @@ public:
ClRecover : Recover;
this->CompileKernel = ClEnableKasan.getNumOccurrences() > 0 ?
ClEnableKasan : CompileKernel;
- }
+ }
bool runOnModule(Module &M) override;
StringRef getPassName() const override { return "AddressSanitizerModule"; }
@@ -2176,8 +2176,8 @@ bool AddressSanitizerModule::InstrumentGlobals(IRBuilder<> &IRB, Module &M, bool
if (CanUsePrivateAliases && ClUsePrivateAliasForGlobals) {
// Create local alias for NewGlobal to avoid crash on ODR between
// instrumented and non-instrumented libraries.
- auto *GA = GlobalAlias::create(GlobalValue::InternalLinkage,
- NameForGlobal + M.getName(), NewGlobal);
+ auto *GA =
+ GlobalAlias::create(GlobalValue::PrivateLinkage, "", NewGlobal);
// With local aliases, we need to provide another externally visible
// symbol __odr_asan_XXX to detect ODR violation.
OpenPOWER on IntegriCloud