13 #ifndef LLVM_CLANG_LIB_CODEGEN_COVERAGEMAPPINGGEN_H 14 #define LLVM_CLANG_LIB_CODEGEN_COVERAGEMAPPINGGEN_H 19 #include "llvm/ADT/DenseMap.h" 20 #include "llvm/IR/GlobalValue.h" 21 #include "llvm/Support/raw_ostream.h" 36 std::vector<SourceRange> SkippedRanges;
52 llvm::SmallDenseMap<const FileEntry *, unsigned, 8> FileEntries;
53 std::vector<llvm::Constant *> FunctionRecords;
54 std::vector<llvm::Constant *> FunctionNames;
55 llvm::StructType *FunctionRecordTy;
56 std::vector<std::string> CoverageMappings;
60 : CGM(CGM), SourceInfo(SourceInfo), FunctionRecordTy(nullptr) {}
68 void addFunctionMappingRecord(llvm::GlobalVariable *FunctionName,
69 StringRef FunctionNameValue,
70 uint64_t FunctionHash,
71 const std::string &CoverageMapping,
79 unsigned getFileID(
const FileEntry *File);
88 llvm::DenseMap<const Stmt *, unsigned> *CounterMap;
93 : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(nullptr) {}
97 llvm::DenseMap<const Stmt *, unsigned> *CounterMap)
98 : CVM(CVM), SM(SM), LangOpts(LangOpts), CounterMap(CounterMap) {}
103 void emitCounterMapping(
const Decl *D, llvm::raw_ostream &OS);
107 void emitEmptyMapping(
const Decl *D, llvm::raw_ostream &OS);
Organizes the per-function state that is used while generating code coverage mapping data...
Decl - This represents one declaration (or definition), e.g.
CoverageMappingGen(CoverageMappingModuleGen &CVM, SourceManager &SM, const LangOptions &LangOpts, llvm::DenseMap< const Stmt *, unsigned > *CounterMap)
Stores additional source code information like skipped ranges which is required by the coverage mappi...
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
This interface provides a way to observe the actions of the preprocessor as it does its thing...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Organizes the cross-function state that is used while generating code coverage mapping data...
void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc) override
Hook called when a source range is skipped.
CoverageMappingModuleGen(CodeGenModule &CGM, CoverageSourceInfo &SourceInfo)
Encodes a location in the source.
ArrayRef< SourceRange > getSkippedRanges() const
Cached information about one file (either on disk or in the virtual file system). ...
CoverageSourceInfo & getSourceInfo() const
This class organizes the cross-function state that is used while generating LLVM code.
Dataflow Directional Tag Classes.
CoverageMappingGen(CoverageMappingModuleGen &CVM, SourceManager &SM, const LangOptions &LangOpts)
Defines the PPCallbacks interface.
Defines the clang::SourceLocation class and associated facilities.
A trivial tuple used to represent a source range.
This class handles loading and caching of source files into memory.