LLVM 20.0.0git
|
#include "llvm/Transforms/Instrumentation/BlockCoverageInference.h"
Public Types | |
using | BlockSet = SmallSetVector< const BasicBlock *, 4 > |
Public Member Functions | |
BlockCoverageInference (const Function &F, bool ForceInstrumentEntry) | |
bool | shouldInstrumentBlock (const BasicBlock &BB) const |
BlockSet | getDependencies (const BasicBlock &BB) const |
uint64_t | getInstrumentedBlocksHash () const |
void | dump (raw_ostream &OS) const |
Dump the inference graph. | |
void | viewBlockCoverageGraph (const DenseMap< const BasicBlock *, bool > *Coverage=nullptr) const |
View the inferred block coverage as a dot file. | |
Friends | |
class | DotFuncBCIInfo |
Definition at line 29 of file BlockCoverageInference.h.
using llvm::BlockCoverageInference::BlockSet = SmallSetVector<const BasicBlock *, 4> |
Definition at line 33 of file BlockCoverageInference.h.
Definition at line 50 of file BlockCoverageInference.cpp.
References assert(), F, and shouldInstrumentBlock().
void BlockCoverageInference::dump | ( | raw_ostream & | OS | ) | const |
Dump the inference graph.
Definition at line 339 of file BlockCoverageInference.cpp.
References F, getInstrumentedBlocksHash(), OS, shouldInstrumentBlock(), and llvm::Twine::utohexstr().
BlockCoverageInference::BlockSet BlockCoverageInference::getDependencies | ( | const BasicBlock & | BB | ) | const |
Deps
such that BB
is covered iff any blocks in Deps
are covered. Definition at line 65 of file BlockCoverageInference.cpp.
References assert(), llvm::BasicBlock::getParent(), and llvm::SetVector< T, Vector, Set, N >::set_union().
Referenced by llvm::DotFuncBCIInfo::isDependent().
uint64_t BlockCoverageInference::getInstrumentedBlocksHash | ( | ) | const |
Definition at line 77 of file BlockCoverageInference.cpp.
References llvm::Data, llvm::JamCRC::getCRC(), shouldInstrumentBlock(), llvm::JamCRC::update(), and llvm::support::endian::write64le().
Referenced by dump().
bool BlockCoverageInference::shouldInstrumentBlock | ( | const BasicBlock & | BB | ) | const |
BB
should be instrumented for coverage. Definition at line 91 of file BlockCoverageInference.cpp.
References assert(), and llvm::BasicBlock::getParent().
Referenced by BlockCoverageInference(), dump(), getInstrumentedBlocksHash(), and llvm::DotFuncBCIInfo::isInstrumented().
void BlockCoverageInference::viewBlockCoverageGraph | ( | const DenseMap< const BasicBlock *, bool > * | Coverage = nullptr | ) | const |
View the inferred block coverage as a dot file.
Filled gray blocks are instrumented, red outlined blocks are found to be covered, red edges show that a block's coverage can be inferred from its successors, and blue edges show that a block's coverage can be inferred from its predecessors.
Definition at line 332 of file BlockCoverageInference.cpp.
References F, Info, and llvm::WriteGraph().
|
friend |
Definition at line 30 of file BlockCoverageInference.h.