Files
clang-p2996/clang/lib/CodeGen/MCDCState.h
NAKAMURA Takumi 1f6a347c8a Refactor: Let MCDC::State have DecisionByStmt and BranchByStmt
- Prune `RegionMCDCBitmapMap` and `RegionCondIDMap`. They are handled
  by `MCDCState`.
- Rename `s/BitmapMap/DecisionByStmt/`. It can handle Decision stuff.
- Rename `s/CondIDMap/BranchByStmt/`. It can be handle Branch stuff.
- `MCDCRecordProcessor`: Use `DecisionParams.BitmapIdx` directly.
2024-02-25 18:33:53 +09:00

47 lines
1.1 KiB
C++

//===---- MCDCState.h - Per-Function MC/DC state ----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Per-Function MC/DC state for PGO
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_LIB_CODEGEN_MCDCSTATE_H
#define LLVM_CLANG_LIB_CODEGEN_MCDCSTATE_H
#include "llvm/ADT/DenseMap.h"
#include "llvm/ProfileData/Coverage/MCDCTypes.h"
namespace clang {
class Stmt;
} // namespace clang
namespace clang::CodeGen::MCDC {
using namespace llvm::coverage::mcdc;
/// Per-Function MC/DC state
struct State {
unsigned BitmapBytes = 0;
struct Decision {
unsigned BitmapIdx;
};
llvm::DenseMap<const Stmt *, Decision> DecisionByStmt;
struct Branch {
ConditionID ID;
};
llvm::DenseMap<const Stmt *, Branch> BranchByStmt;
};
} // namespace clang::CodeGen::MCDC
#endif // LLVM_CLANG_LIB_CODEGEN_MCDCSTATE_H