summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenPGO.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-20 20:00:41 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-20 20:00:41 +0000
commit7f817a7d8d2062cb805cf720467bb3306dae2b3f (patch)
tree50ddb279dc6d87b216e63f17cd12375a3e0b44ce /lib/CodeGen/CodeGenPGO.cpp
parentcdbf2c3796769961bd29f376314a7f050033988f (diff)
downloadclang-7f817a7d8d2062cb805cf720467bb3306dae2b3f.tar.gz
clang-7f817a7d8d2062cb805cf720467bb3306dae2b3f.tar.bz2
clang-7f817a7d8d2062cb805cf720467bb3306dae2b3f.tar.xz
PGO: Change runtime prefix from pgo to profile
These functions are in the profile runtime. PGO comes later. Unfortunately, there's only room for 16 characters in a Darwin section, so use __llvm_prf_ instead of __llvm_profile_ for section names. <rdar://problem/15943240> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenPGO.cpp')
-rw-r--r--lib/CodeGen/CodeGenPGO.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/CodeGen/CodeGenPGO.cpp b/lib/CodeGen/CodeGenPGO.cpp
index 96409fef64..2dbe88cb27 100644
--- a/lib/CodeGen/CodeGenPGO.cpp
+++ b/lib/CodeGen/CodeGenPGO.cpp
@@ -178,7 +178,7 @@ void CodeGenPGO::setFuncName(llvm::Function *Fn) {
}
static llvm::Function *getRegisterFunc(CodeGenModule &CGM) {
- return CGM.getModule().getFunction("__llvm_pgo_register_functions");
+ return CGM.getModule().getFunction("__llvm_profile_register_functions");
}
static llvm::BasicBlock *getOrInsertRegisterBB(CodeGenModule &CGM) {
@@ -195,7 +195,7 @@ static llvm::BasicBlock *getOrInsertRegisterBB(CodeGenModule &CGM) {
auto *RegisterFTy = llvm::FunctionType::get(VoidTy, false);
auto *RegisterF = llvm::Function::Create(RegisterFTy,
llvm::GlobalValue::InternalLinkage,
- "__llvm_pgo_register_functions",
+ "__llvm_profile_register_functions",
&CGM.getModule());
RegisterF->setUnnamedAddr(true);
if (CGM.getCodeGenOpts().DisableRedZone)
@@ -212,7 +212,7 @@ static llvm::Constant *getOrInsertRuntimeRegister(CodeGenModule &CGM) {
auto *VoidTy = llvm::Type::getVoidTy(CGM.getLLVMContext());
auto *VoidPtrTy = llvm::Type::getInt8PtrTy(CGM.getLLVMContext());
auto *RuntimeRegisterTy = llvm::FunctionType::get(VoidTy, VoidPtrTy, false);
- return CGM.getModule().getOrInsertFunction("__llvm_pgo_register_function",
+ return CGM.getModule().getOrInsertFunction("__llvm_profile_register_function",
RuntimeRegisterTy);
}
@@ -221,15 +221,15 @@ static bool isMachO(const CodeGenModule &CGM) {
}
static StringRef getCountersSection(const CodeGenModule &CGM) {
- return isMachO(CGM) ? "__DATA,__llvm_pgo_cnts" : "__llvm_pgo_cnts";
+ return isMachO(CGM) ? "__DATA,__llvm_prf_cnts" : "__llvm_prf_cnts";
}
static StringRef getNameSection(const CodeGenModule &CGM) {
- return isMachO(CGM) ? "__DATA,__llvm_pgo_names" : "__llvm_pgo_names";
+ return isMachO(CGM) ? "__DATA,__llvm_prf_names" : "__llvm_prf_names";
}
static StringRef getDataSection(const CodeGenModule &CGM) {
- return isMachO(CGM) ? "__DATA,__llvm_pgo_data" : "__llvm_pgo_data";
+ return isMachO(CGM) ? "__DATA,__llvm_prf_data" : "__llvm_prf_data";
}
llvm::GlobalVariable *CodeGenPGO::buildDataVar() {
@@ -295,7 +295,7 @@ llvm::Function *CodeGenPGO::emitInitialization(CodeGenModule &CGM) {
return nullptr;
// Only need to create this once per module.
- if (CGM.getModule().getFunction("__llvm_pgo_init"))
+ if (CGM.getModule().getFunction("__llvm_profile_init"))
return nullptr;
// Get the function to call at initialization.
@@ -307,7 +307,7 @@ llvm::Function *CodeGenPGO::emitInitialization(CodeGenModule &CGM) {
auto *VoidTy = llvm::Type::getVoidTy(CGM.getLLVMContext());
auto *F = llvm::Function::Create(llvm::FunctionType::get(VoidTy, false),
llvm::GlobalValue::InternalLinkage,
- "__llvm_pgo_init", &CGM.getModule());
+ "__llvm_profile_init", &CGM.getModule());
F->setUnnamedAddr(true);
F->addFnAttr(llvm::Attribute::NoInline);
if (CGM.getCodeGenOpts().DisableRedZone)