Skip to content

Commit e99a087

Browse files
PiJouleststellar
authored andcommitted
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 ------------------------------------------------------------------------
1 parent bead8bf commit e99a087

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ struct AddressSanitizer {
677677
FunctionCallee AsanMemmove, AsanMemcpy, AsanMemset;
678678
InlineAsm *EmptyAsm;
679679
Value *LocalDynamicShadow = nullptr;
680-
GlobalsMetadata GlobalsMD;
680+
const GlobalsMetadata &GlobalsMD;
681681
DenseMap<const AllocaInst *, bool> ProcessedAllocas;
682682
};
683683

@@ -783,7 +783,7 @@ class ModuleAddressSanitizer {
783783
}
784784
int GetAsanVersion(const Module &M) const;
785785

786-
GlobalsMetadata GlobalsMD;
786+
const GlobalsMetadata &GlobalsMD;
787787
bool CompileKernel;
788788
bool Recover;
789789
bool UseGlobalsGC;

0 commit comments

Comments
 (0)