LLVM: lib/ProfileData/Coverage/CoverageMappingWriter.cpp File Reference (original) (raw)
#include "[llvm/ProfileData/Coverage/CoverageMappingWriter.h](CoverageMappingWriter%5F8h%5Fsource.html)"#include "[llvm/ADT/ArrayRef.h](ArrayRef%5F8h%5Fsource.html)"#include "[llvm/ADT/SmallVector.h](SmallVector%5F8h%5Fsource.html)"#include "[llvm/ADT/StringExtras.h](StringExtras%5F8h%5Fsource.html)"#include "[llvm/ProfileData/InstrProf.h](InstrProf%5F8h%5Fsource.html)"#include "[llvm/Support/Compression.h](Compression%5F8h%5Fsource.html)"#include "[llvm/Support/LEB128.h](LEB128%5F8h%5Fsource.html)"#include "[llvm/Support/raw_ostream.h](raw%5F%5Fostream%5F8h%5Fsource.html)"#include <cassert>#include <limits>#include <vector>
Go to the source code of this file.
| Functions | |
|---|---|
| static unsigned | encodeCounter (ArrayRef< CounterExpression > Expressions, Counter C) |
| Encode the counter. | |
| static void | writeCounter (ArrayRef< CounterExpression > Expressions, Counter C, raw_ostream &OS) |
Function Documentation
◆ encodeCounter()
| 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 137 of file CoverageMappingWriter.cpp.
References assert(), llvm::CallingConv::C, and llvm::coverage::Counter::EncodingTagBits.
Referenced by writeCounter().
◆ writeCounter()
| void writeCounter ( ArrayRef< CounterExpression > Expressions, Counter C, raw_ostream & OS ) | static |
|---|
Definition at line 148 of file CoverageMappingWriter.cpp.
References llvm::CallingConv::C, encodeCounter(), and llvm::encodeULEB128().
Referenced by llvm::coverage::CoverageMappingWriter::write().