aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2016-04-01 16:43:30 +0000
committerRong Xu <xur@google.com>2016-04-01 16:43:30 +0000
commit8e8fe859e059ce0d0704596c5c6a7ab02f39c5ee (patch)
tree70df5a8810cf47f3013623517b49b39086c7d799 /llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
parenta05e0ff22376f4cbc6707841b3760c6f9f587663 (diff)
downloadllvm-8e8fe859e059ce0d0704596c5c6a7ab02f39c5ee.zip
llvm-8e8fe859e059ce0d0704596c5c6a7ab02f39c5ee.tar.gz
llvm-8e8fe859e059ce0d0704596c5c6a7ab02f39c5ee.tar.bz2
[PGO] Refactor PGOFuncName meta data code to be used in clang
Refactor the code that gets and creates PGOFuncName meta data so that it can be used in clang's value profile annotation. Differential Revision: http://reviews.llvm.org/D18623 llvm-svn: 265149
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index 50a65b9..5feeccb 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -752,14 +752,8 @@ void PGOUseFunc::annotateIndirectCallSites() {
if (DisableValueProfiling)
return;
- // Write out the PGOFuncName if this is different from it's raw name.
- // This should only apply to internal linkage functions only.
- const std::string &FuncName = getPGOFuncName(F);
- if (FuncName != F.getName()) {
- LLVMContext &C = F.getContext();
- MDNode *N = MDNode::get(C, MDString::get(C, FuncName.c_str()));
- F.setMetadata("PGOFuncName", N);
- }
+ // Create the PGOFuncName meta data.
+ createPGOFuncNameMetadata(F);
unsigned IndirectCallSiteIndex = 0;
PGOIndirectCallSiteVisitor ICV;