[asan] use GlobalValue::PrivateLinkage for coverage guard to save quite a bit of code size
llvm-svn: 194800
This commit is contained in:
parent
67421c1087
commit
0604c62d7b
|
@ -1187,7 +1187,7 @@ bool AddressSanitizer::InjectCoverage(Function &F) {
|
||||||
IRBuilder<> IRB(F.getEntryBlock().getFirstInsertionPt());
|
IRBuilder<> IRB(F.getEntryBlock().getFirstInsertionPt());
|
||||||
Type *Int8Ty = IRB.getInt8Ty();
|
Type *Int8Ty = IRB.getInt8Ty();
|
||||||
GlobalVariable *Guard = new GlobalVariable(
|
GlobalVariable *Guard = new GlobalVariable(
|
||||||
*F.getParent(), Int8Ty, false, F.getLinkage(),
|
*F.getParent(), Int8Ty, false, GlobalValue::PrivateLinkage,
|
||||||
Constant::getNullValue(Int8Ty), "__asan_gen_cov_" + F.getName());
|
Constant::getNullValue(Int8Ty), "__asan_gen_cov_" + F.getName());
|
||||||
LoadInst *Load = IRB.CreateLoad(Guard);
|
LoadInst *Load = IRB.CreateLoad(Guard);
|
||||||
Load->setAtomic(Monotonic);
|
Load->setAtomic(Monotonic);
|
||||||
|
|
Loading…
Reference in New Issue