diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2024-10-02 21:02:20 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2024-10-03 17:56:19 +0900 |
commit | 1cc3ffab4076ad727a2346b17b34486d848da9f6 (patch) | |
tree | 73f870a6ab37a767fd253aa78c954db3e935a7ae /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 7ad566d575b9a3657f2bfd37005ef475154dd86d (diff) | |
download | llvm-1cc3ffab4076ad727a2346b17b34486d848da9f6.zip llvm-1cc3ffab4076ad727a2346b17b34486d848da9f6.tar.gz llvm-1cc3ffab4076ad727a2346b17b34486d848da9f6.tar.bz2 |
clangCodeGen: Reformat and refactor. NFC.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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); |