[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.
llvm-svn: 287117
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index 031effb..730e28a 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -357,9 +357,9 @@
// Create variable for module (compilation unit) name
Constant *ModNameStrConst =
ConstantDataArray::getString(M.getContext(), M.getName(), true);
- GlobalVariable *ModuleName =
- new GlobalVariable(M, ModNameStrConst->getType(), true,
- GlobalValue::PrivateLinkage, ModNameStrConst);
+ GlobalVariable *ModuleName = new GlobalVariable(
+ M, ModNameStrConst->getType(), true, GlobalValue::PrivateLinkage,
+ ModNameStrConst, "__sancov_gen_modname");
if (Options.TracePCGuard) {
if (HasSancovGuardsSection) {
Function *CtorFunc;