InstrProf: Fix a shadowing error that would break length of profile names
We try to use the member variable "FuncName" here, but we've also used that name as a parameter. This ends with us getting the length of the function name wrong when we generate the coverage data. llvm-svn: 235565
This commit is contained in:
parent
46e9f9df15
commit
60d852ba5b
|
@ -729,7 +729,7 @@ void CodeGenPGO::emitCounterRegionMapping(const Decl *D) {
|
|||
}
|
||||
|
||||
void
|
||||
CodeGenPGO::emitEmptyCounterMapping(const Decl *D, StringRef FuncName,
|
||||
CodeGenPGO::emitEmptyCounterMapping(const Decl *D, StringRef Name,
|
||||
llvm::GlobalValue::LinkageTypes Linkage) {
|
||||
if (SkipCoverageMapping)
|
||||
return;
|
||||
|
@ -749,7 +749,7 @@ CodeGenPGO::emitEmptyCounterMapping(const Decl *D, StringRef FuncName,
|
|||
if (CoverageMapping.empty())
|
||||
return;
|
||||
|
||||
setFuncName(FuncName, Linkage);
|
||||
setFuncName(Name, Linkage);
|
||||
CGM.getCoverageMapping()->addFunctionMappingRecord(
|
||||
FuncNameVar, FuncName, FunctionHash, CoverageMapping);
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
// Since foo is never emitted, there should not be a profile name for it.
|
||||
|
||||
// CHECK-DAG: @__llvm_profile_name_bar = {{.*}} section "{{.*}}__llvm_prf_names"
|
||||
// CHECK-DAG: @__llvm_profile_name_baz = {{.*}} section "{{.*}}__llvm_prf_names"
|
||||
// CHECK-DAG: @"__llvm_profile_name_unused_names.c:qux" = {{.*}} section "{{.*}}__llvm_prf_names"
|
||||
// CHECK-DAG: @__llvm_profile_name_bar = {{.*}} [3 x i8] c"bar", section "{{.*}}__llvm_prf_names"
|
||||
// CHECK-DAG: @__llvm_profile_name_baz = {{.*}} [3 x i8] c"baz", section "{{.*}}__llvm_prf_names"
|
||||
// CHECK-DAG: @"__llvm_profile_name_unused_names.c:qux" = {{.*}} [18 x i8] c"unused_names.c:qux", section "{{.*}}__llvm_prf_names"
|
||||
|
||||
// SYSHEADER-NOT: @__llvm_profile_name_foo =
|
||||
|
||||
|
|
Loading…
Reference in New Issue