summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2019-10-01 20:30:46 +0000
committerLeonard Chan <leonardchan@google.com>2019-10-01 20:30:46 +0000
commit63663616f5a098e5c789fd91361312f4869f00de (patch)
tree611460070e97bf51ccedc34ba5b1d3bae5bb7cff /llvm/lib/Transforms
parent603650213b1aee2a03ba879ba9d8e6eb65a06694 (diff)
downloadbcm5719-llvm-63663616f5a098e5c789fd91361312f4869f00de.tar.gz
bcm5719-llvm-63663616f5a098e5c789fd91361312f4869f00de.zip
[ASan] Make GlobalsMD member a const reference.
PR42924 points out that copying the GlobalsMetadata type during construction of AddressSanitizer can result in exteremely lengthened build times for translation units that have many globals. This can be addressed by just making the GlobalsMD member in AddressSanitizer a reference to avoid the copy. The GlobalsMetadata type is already passed to the constructor as a reference anyway. Differential Revision: https://reviews.llvm.org/D68287 llvm-svn: 373389
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 4aea0fd4e73..7a46b0777bc 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -692,7 +692,7 @@ private:
FunctionCallee AsanMemmove, AsanMemcpy, AsanMemset;
InlineAsm *EmptyAsm;
Value *LocalDynamicShadow = nullptr;
- GlobalsMetadata GlobalsMD;
+ const GlobalsMetadata &GlobalsMD;
DenseMap<const AllocaInst *, bool> ProcessedAllocas;
};
@@ -798,7 +798,7 @@ private:
}
int GetAsanVersion(const Module &M) const;
- GlobalsMetadata GlobalsMD;
+ const GlobalsMetadata &GlobalsMD;
bool CompileKernel;
bool Recover;
bool UseGlobalsGC;
OpenPOWER on IntegriCloud