diff options
author | Bob Wilson <bob.wilson@apple.com> | 2014-03-06 06:10:02 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2014-03-06 06:10:02 +0000 |
commit | 5ec8fe19cf10d64f17ba24e066c7450ee95abecb (patch) | |
tree | 4e8863b01b86325e1b3174def88267f2ddaf875b /clang/lib/CodeGen/CGObjC.cpp | |
parent | 0a685a9a52e1471a9ee15fe6ed7a0b25b7915a3f (diff) | |
download | bcm5719-llvm-5ec8fe19cf10d64f17ba24e066c7450ee95abecb.tar.gz bcm5719-llvm-5ec8fe19cf10d64f17ba24e066c7450ee95abecb.zip |
PGO: add instrumentation for Objective-C methods.
llvm-svn: 203085
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index c1d7d2024ce..800d3a97dc2 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/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 |