LLVM API Documentation

Functions
CoverageMappingWriter.cpp File Reference
#include "llvm/ProfileData/CoverageMappingWriter.h"
#include "llvm/Support/LEB128.h"
Include dependency graph for CoverageMappingWriter.cpp:

Go to the source code of this file.

Functions

static unsigned countFileIDs (ArrayRef< CounterMappingRegion > Regions, unsigned FileID)
 Return the number of regions that have the given FileID.
static unsigned encodeCounter (ArrayRef< CounterExpression > Expressions, Counter C)
 Encode the counter.
static void writeCounter (ArrayRef< CounterExpression > Expressions, Counter C, raw_ostream &OS)

Function Documentation

static unsigned countFileIDs ( ArrayRef< CounterMappingRegion Regions,
unsigned  FileID 
) [static]

Return the number of regions that have the given FileID.

Definition at line 80 of file CoverageMappingWriter.cpp.

References I.

Referenced by llvm::coverage::CoverageMappingWriter::write().

static unsigned encodeCounter ( ArrayRef< CounterExpression Expressions,
Counter  C 
) [static]

Encode the counter.

The encoding uses the following format: Low 2 bits - Tag: Counter::Zero(0) - A Counter with kind Counter::Zero Counter::CounterValueReference(1) - A counter with kind Counter::CounterValueReference Counter::Expression(2) + CounterExpression::Subtract(0) - A counter with kind Counter::Expression and an expression with kind CounterExpression::Subtract Counter::Expression(2) + CounterExpression::Add(1) - A counter with kind Counter::Expression and an expression with kind CounterExpression::Add Remaining bits - Counter/Expression ID.

Definition at line 106 of file CoverageMappingWriter.cpp.

References llvm::coverage::Counter::EncodingTagBits, llvm::coverage::Counter::getCounterID(), llvm::coverage::Counter::getExpressionID(), llvm::coverage::Counter::getKind(), and llvm::coverage::Counter::isExpression().

Referenced by writeCounter().

static void writeCounter ( ArrayRef< CounterExpression Expressions,
Counter  C,
raw_ostream OS 
) [static]