summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2014-03-06 20:24:27 +0000
committerBob Wilson <bob.wilson@apple.com>2014-03-06 20:24:27 +0000
commitc845c00a5b0fba33ef1eab4fd72e70fe3a211f7d (patch)
tree262c9ee4ab0b178be1b80d2d3e0f288662300adc /clang/lib/CodeGen/CGBlocks.cpp
parent6292a140ee10c47bb1562d15e174b48a7c43f48b (diff)
downloadbcm5719-llvm-c845c00a5b0fba33ef1eab4fd72e70fe3a211f7d.tar.gz
bcm5719-llvm-c845c00a5b0fba33ef1eab4fd72e70fe3a211f7d.zip
PGO: Add support for Objective-C blocks.
llvm-svn: 203157
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index b1717b38901..a75f341b3bf 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -1200,8 +1200,14 @@ CodeGenFunction::GenerateBlockFunction(GlobalDecl GD,
if (IsLambdaConversionToBlock)
EmitLambdaBlockInvokeBody();
- else
+ else {
+ PGO.assignRegionCounters(blockDecl, fn);
+ RegionCounter Cnt = getPGORegionCounter(blockDecl->getBody());
+ Cnt.beginRegion(Builder);
EmitStmt(blockDecl->getBody());
+ PGO.emitWriteoutFunction();
+ PGO.destroyRegionCounters();
+ }
// Remember where we were...
llvm::BasicBlock *resume = Builder.GetInsertBlock();
OpenPOWER on IntegriCloud