From 5ec8fe19cf10d64f17ba24e066c7450ee95abecb Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Thu, 6 Mar 2014 06:10:02 +0000 Subject: PGO: add instrumentation for Objective-C methods. llvm-svn: 203085 --- clang/lib/CodeGen/CGObjC.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/CodeGen/CGObjC.cpp') 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(OMD->getBody())); + RegionCounter Cnt = getPGORegionCounter(OMD->getBody()); + Cnt.beginRegion(Builder); EmitCompoundStmtWithoutScope(*cast(OMD->getBody())); FinishFunction(OMD->getBodyRBrace()); + PGO.emitWriteoutFunction(); + PGO.destroyRegionCounters(); } /// emitStructGetterCall - Call the runtime function to load a property -- cgit v1.2.3