[llvm-branch-commits] [llvm] e99a087 - Merging r373389:

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Nov 27 14:11:02 PST 2019


Author: Leonard Chan
Date: 2019-11-27T13:57:45-08:00
New Revision: e99a087fff6c547cae1192f54edcc474f46f6567

URL: https://github.com/llvm/llvm-project/commit/e99a087fff6c547cae1192f54edcc474f46f6567
DIFF: https://github.com/llvm/llvm-project/commit/e99a087fff6c547cae1192f54edcc474f46f6567.diff

LOG: 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
------------------------------------------------------------------------

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Removed: 
    


################################################################################
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 @@ struct AddressSanitizer {
   FunctionCallee AsanMemmove, AsanMemcpy, AsanMemset;
   InlineAsm *EmptyAsm;
   Value *LocalDynamicShadow = nullptr;
-  GlobalsMetadata GlobalsMD;
+  const GlobalsMetadata &GlobalsMD;
   DenseMap<const AllocaInst *, bool> ProcessedAllocas;
 };
 
@@ -783,7 +783,7 @@ class ModuleAddressSanitizer {
   }
   int GetAsanVersion(const Module &M) const;
 
-  GlobalsMetadata GlobalsMD;
+  const GlobalsMetadata &GlobalsMD;
   bool CompileKernel;
   bool Recover;
   bool UseGlobalsGC;


        


More information about the llvm-branch-commits mailing list