llvm.org GIT mirror llvm / 195a4bc
[sancov] Name the global containing the main source file name If the global name doesn't start with __sancov_gen, ASan will insert unecessary red zones around it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287117 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 4 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
356356 // Create variable for module (compilation unit) name
357357 Constant *ModNameStrConst =
358358 ConstantDataArray::getString(M.getContext(), M.getName(), true);
359 GlobalVariable *ModuleName =
360 new GlobalVariable(M, ModNameStrConst->getType(), true,
361 GlobalValue::PrivateLinkage, ModNameStrConst);
359 GlobalVariable *ModuleName = new GlobalVariable(
360 M, ModNameStrConst->getType(), true, GlobalValue::PrivateLinkage,
361 ModNameStrConst, "__sancov_gen_modname");
362362 if (Options.TracePCGuard) {
363363 if (HasSancovGuardsSection) {
364364 Function *CtorFunc;
4848
4949 ; CHECK1-LABEL: define internal void @sancov.module_ctor
5050 ; CHECK1-NOT: ret
51 ; CHECK1: call void @__sanitizer_cov_module_init({{.*}}, i64 2,
51 ; CHECK1: call void @__sanitizer_cov_module_init({{.*}}, i64 2, {{.*}}@__sancov_gen_modname
5252 ; CHECK1: ret
5353
5454 ; CHECK_WITH_CHECK-LABEL: define void @foo