summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2014-03-06 06:10:02 +0000
committerBob Wilson <bob.wilson@apple.com>2014-03-06 06:10:02 +0000
commit4084bb9da5b07d9a074e1cfec8279daa4d61ab56 (patch)
tree2769a146c37d3f535741607a2355d08c501b747c /lib/CodeGen/CGObjC.cpp
parent67fafb973cfbd0ac08f3177a344e5cdd4fee4ae6 (diff)
downloadclang-4084bb9da5b07d9a074e1cfec8279daa4d61ab56.tar.gz
clang-4084bb9da5b07d9a074e1cfec8279daa4d61ab56.tar.bz2
clang-4084bb9da5b07d9a074e1cfec8279daa4d61ab56.tar.xz
PGO: add instrumentation for Objective-C methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index c1d7d2024c..800d3a97dc 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -502,9 +502,14 @@ static llvm::Value *emitARCRetainLoadOfScalar(CodeGenFunction &CGF,
/// its pointer, name, and types registered in the class struture.
void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) {
StartObjCMethod(OMD, OMD->getClassInterface(), OMD->getLocStart());
+ PGO.assignRegionCounters(OMD, CurFn);
assert(isa<CompoundStmt>(OMD->getBody()));
+ RegionCounter Cnt = getPGORegionCounter(OMD->getBody());
+ Cnt.beginRegion(Builder);
EmitCompoundStmtWithoutScope(*cast<CompoundStmt>(OMD->getBody()));
FinishFunction(OMD->getBodyRBrace());
+ PGO.emitWriteoutFunction();
+ PGO.destroyRegionCounters();
}
/// emitStructGetterCall - Call the runtime function to load a property