summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-04-23 23:06:47 +0000
committerJustin Bogner <mail@justinbogner.com>2015-04-23 23:06:47 +0000
commit66242d6c5e6a99ed81339d166b0bac7cfbdf1975 (patch)
tree3699d8df58dd13457707e2f8d90e622fd060eef1 /clang/lib/CodeGen/CGExpr.cpp
parentd86e90abdd1e9cd1018aa5dc5522b266c6bac937 (diff)
downloadbcm5719-llvm-66242d6c5e6a99ed81339d166b0bac7cfbdf1975.tar.gz
bcm5719-llvm-66242d6c5e6a99ed81339d166b0bac7cfbdf1975.zip
InstrProf: Stop using RegionCounter outside of CodeGenPGO (NFC)
The RegionCounter type does a lot of legwork, but most of it is only meaningful within the implementation of CodeGenPGO. The uses elsewhere in CodeGen generally just want to increment or read counters, so do that directly. llvm-svn: 235664
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 4147317963b..0440359f880 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2860,7 +2860,6 @@ EmitConditionalOperatorLValue(const AbstractConditionalOperator *expr) {
}
OpaqueValueMapping binding(*this, expr);
- RegionCounter Cnt = getPGORegionCounter(expr);
const Expr *condExpr = expr->getCond();
bool CondExprBool;
@@ -2871,7 +2870,7 @@ EmitConditionalOperatorLValue(const AbstractConditionalOperator *expr) {
if (!ContainsLabel(dead)) {
// If the true case is live, we need to track its region.
if (CondExprBool)
- Cnt.beginRegion(Builder);
+ incrementProfileCounter(expr);
return EmitLValue(live);
}
}
@@ -2881,11 +2880,11 @@ EmitConditionalOperatorLValue(const AbstractConditionalOperator *expr) {
llvm::BasicBlock *contBlock = createBasicBlock("cond.end");
ConditionalEvaluation eval(*this);
- EmitBranchOnBoolExpr(condExpr, lhsBlock, rhsBlock, Cnt.getCount());
+ EmitBranchOnBoolExpr(condExpr, lhsBlock, rhsBlock, getProfileCount(expr));
// Any temporaries created here are conditional.
EmitBlock(lhsBlock);
- Cnt.beginRegion(Builder);
+ incrementProfileCounter(expr);
eval.begin(*this);
Optional<LValue> lhs =
EmitLValueOrThrowExpression(*this, expr->getTrueExpr());
OpenPOWER on IntegriCloud