diff options
author | Leonard Chan <leonardchan@google.com> | 2019-10-01 20:30:46 +0000 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2019-11-27 13:57:45 -0800 |
commit | e99a087fff6c547cae1192f54edcc474f46f6567 (patch) | |
tree | 2255df00e9adcd36e9a5d0bce95dede1242ae54a | |
parent | bead8bf31fb4a6bf02af67bd3029adb5dedf704f (diff) | |
download | llvm-e99a087fff6c547cae1192f54edcc474f46f6567.tar.gz |
Merging r373389:
------------------------------------------------------------------------
r373389 | leonardchan | 2019-10-01 13:30:46 -0700 (Tue, 01 Oct 2019) | 10 lines
[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
------------------------------------------------------------------------
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 6821e214e921..89a90eab8978 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -677,7 +677,7 @@ private: FunctionCallee AsanMemmove, AsanMemcpy, AsanMemset; InlineAsm *EmptyAsm; Value *LocalDynamicShadow = nullptr; - GlobalsMetadata GlobalsMD; + const GlobalsMetadata &GlobalsMD; DenseMap<const AllocaInst *, bool> ProcessedAllocas; }; @@ -783,7 +783,7 @@ private: } int GetAsanVersion(const Module &M) const; - GlobalsMetadata GlobalsMD; + const GlobalsMetadata &GlobalsMD; bool CompileKernel; bool Recover; bool UseGlobalsGC; |