r251072 - Use newly introduced interfaces in LLVM (NFC)
Xinliang David Li via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 22 15:25:11 PDT 2015
Author: davidxl
Date: Thu Oct 22 17:25:11 2015
New Revision: 251072
URL: http://llvm.org/viewvc/llvm-project?rev=251072&view=rev
Log:
Use newly introduced interfaces in LLVM (NFC)
Replaced references to raw strings in instrumentation
and coverage code.
Modified:
cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenPGO.cpp?rev=251072&r1=251071&r2=251072&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenPGO.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenPGO.cpp Thu Oct 22 17:25:11 2015
@@ -73,7 +73,7 @@ void CodeGenPGO::createFuncNameVar(llvm:
llvm::ConstantDataArray::getString(CGM.getLLVMContext(), FuncName, false);
FuncNameVar =
new llvm::GlobalVariable(CGM.getModule(), Value->getType(), true, Linkage,
- Value, "__llvm_profile_name_" + FuncName);
+ Value, llvm::getInstrProfNameVarPrefix() + FuncName);
// Hide the symbol so that we correctly get a copy for each executable.
if (!llvm::GlobalValue::isLocalLinkage(FuncNameVar->getLinkage()))
Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp?rev=251072&r1=251071&r2=251072&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp (original)
+++ cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp Thu Oct 22 17:25:11 2015
@@ -879,7 +879,7 @@ static bool isMachO(const CodeGenModule
}
static StringRef getCoverageSection(const CodeGenModule &CGM) {
- return isMachO(CGM) ? "__DATA,__llvm_covmap" : "__llvm_covmap";
+ return llvm::getInstrProfCoverageSectionName(isMachO(CGM));
}
static void dump(llvm::raw_ostream &OS, StringRef FunctionName,
@@ -1011,7 +1011,7 @@ void CoverageMappingModuleGen::emit() {
auto CovData = new llvm::GlobalVariable(CGM.getModule(), CovDataTy, true,
llvm::GlobalValue::InternalLinkage,
CovDataVal,
- "__llvm_coverage_mapping");
+ llvm::getCoverageMappingVarName());
CovData->setSection(getCoverageSection(CGM));
CovData->setAlignment(8);
More information about the cfe-commits
mailing list