summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-04-15 00:50:54 +0000
committerJustin Bogner <mail@justinbogner.com>2014-04-15 00:50:54 +0000
commit81ab90f7ed3c7420fca87c7339c823f136dcc4e5 (patch)
treefa6e1216d6a3f5f0efbbe8db3cb3ffa8f88589ad /clang/lib/CodeGen/CGStmt.cpp
parentddfadb46545686450598df07db5139fddeabba89 (diff)
downloadbcm5719-llvm-81ab90f7ed3c7420fca87c7339c823f136dcc4e5.tar.gz
bcm5719-llvm-81ab90f7ed3c7420fca87c7339c823f136dcc4e5.zip
CodeGen: Handle CapturedStmt in instrumentation based profiling
CapturedStmt was being ignored by instrumentation based profiling, and its counters attributed to the containing function. Instead, we need to treat this as a top level entity, like we do with blocks. llvm-svn: 206231
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index d50d8b959a8..9ea53b3e1fb 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -1962,8 +1962,11 @@ CodeGenFunction::GenerateCapturedStmtFunction(const CapturedDecl *CD,
CXXThisValue = EmitLoadOfLValue(ThisLValue, Loc).getScalarVal();
}
+ PGO.assignRegionCounters(CD, F);
CapturedStmtInfo->EmitBody(*this, CD->getBody());
FinishFunction(CD->getBodyRBrace());
+ PGO.emitInstrumentationData();
+ PGO.destroyRegionCounters();
return F;
}
OpenPOWER on IntegriCloud