Skip to content

Commit 6366361

Browse files
committed
[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
1 parent 6036502 commit 6366361

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
@@ -692,7 +692,7 @@ struct AddressSanitizer {
692692
FunctionCallee AsanMemmove, AsanMemcpy, AsanMemset;
693693
InlineAsm *EmptyAsm;
694694
Value *LocalDynamicShadow = nullptr;
695-
GlobalsMetadata GlobalsMD;
695+
const GlobalsMetadata &GlobalsMD;
696696
DenseMap<const AllocaInst *, bool> ProcessedAllocas;
697697
};
698698

@@ -798,7 +798,7 @@ class ModuleAddressSanitizer {
798798
}
799799
int GetAsanVersion(const Module &M) const;
800800

801-
GlobalsMetadata GlobalsMD;
801+
const GlobalsMetadata &GlobalsMD;
802802
bool CompileKernel;
803803
bool Recover;
804804
bool UseGlobalsGC;

0 commit comments

Comments
 (0)