[PATCH] D68287: [ASan] Make GlobalsMD member a const reference

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 11:42:59 PDT 2019


leonardchan created this revision.
leonardchan added reviewers: phosek, chandlerc, philip.pfaffe, fedor.sergeev, vitalybuka.
leonardchan added a project: Sanitizers.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

  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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68287

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


Index: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -692,7 +692,7 @@
   FunctionCallee AsanMemmove, AsanMemcpy, AsanMemset;
   InlineAsm *EmptyAsm;
   Value *LocalDynamicShadow = nullptr;
-  GlobalsMetadata GlobalsMD;
+  const GlobalsMetadata &GlobalsMD;
   DenseMap<const AllocaInst *, bool> ProcessedAllocas;
 };
 
@@ -798,7 +798,7 @@
   }
   int GetAsanVersion(const Module &M) const;
 
-  GlobalsMetadata GlobalsMD;
+  const GlobalsMetadata &GlobalsMD;
   bool CompileKernel;
   bool Recover;
   bool UseGlobalsGC;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68287.222662.patch
Type: text/x-patch
Size: 724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191001/0ce75551/attachment.bin>


More information about the llvm-commits mailing list