From 1cc3ffab4076ad727a2346b17b34486d848da9f6 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Wed, 2 Oct 2024 21:02:20 +0900 Subject: clangCodeGen: Reformat and refactor. NFC. --- clang/lib/CodeGen/CodeGenFunction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index eda96f3..24723e3 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -1762,6 +1762,8 @@ void CodeGenFunction::EmitBranchToCounterBlock( if (!InstrumentRegions || !isInstrumentedCondition(Cond)) return EmitBranchOnBoolExpr(Cond, TrueBlock, FalseBlock, TrueCount, LH); + const Stmt *CntrStmt = (CntrIdx ? CntrIdx : Cond); + llvm::BasicBlock *ThenBlock = nullptr; llvm::BasicBlock *ElseBlock = nullptr; llvm::BasicBlock *NextBlock = nullptr; @@ -1814,7 +1816,7 @@ void CodeGenFunction::EmitBranchToCounterBlock( EmitBlock(CounterIncrBlock); // Increment corresponding counter; if index not provided, use Cond as index. - incrementProfileCounter(CntrIdx ? CntrIdx : Cond); + incrementProfileCounter(CntrStmt); // Go to the next block. EmitBranch(NextBlock); -- cgit v1.1