}
unsigned SourceCoverageView::getFirstUncoveredLineNo() {
- const auto MinSegIt =
- find_if(CoverageInfo, [](const coverage::CoverageSegment &S) {
- return S.HasCount && S.Count == 0;
- });
+ const auto MinSegIt = find_if(CoverageInfo, [](const CoverageSegment &S) {
+ return S.HasCount && S.Count == 0;
+ });
// There is no uncovered line, return zero.
if (MinSegIt == CoverageInfo.end())
std::unique_ptr<SourceCoverageView>
SourceCoverageView::create(StringRef SourceName, const MemoryBuffer &File,
const CoverageViewOptions &Options,
- coverage::CoverageData &&CoverageInfo) {
+ CoverageData &&CoverageInfo) {
switch (Options.Format) {
case CoverageViewOptions::OutputFormat::Text:
return llvm::make_unique<SourceCoverageViewText>(
}
void SourceCoverageView::addExpansion(
- const coverage::CounterMappingRegion &Region,
+ const CounterMappingRegion &Region,
std::unique_ptr<SourceCoverageView> View) {
ExpansionSubViews.emplace_back(Region, std::move(View));
}
namespace llvm {
+using namespace coverage;
+
class CoverageFiltersMatchAll;
class SourceCoverageView;
/// \brief A view that represents a macro or include expansion.
struct ExpansionView {
- coverage::CounterMappingRegion Region;
+ CounterMappingRegion Region;
std::unique_ptr<SourceCoverageView> View;
- ExpansionView(const coverage::CounterMappingRegion &Region,
+ ExpansionView(const CounterMappingRegion &Region,
std::unique_ptr<SourceCoverageView> View)
: Region(Region), View(std::move(View)) {}
ExpansionView(ExpansionView &&RHS)
/// \brief Create an index which lists reports for the given source files.
virtual Error createIndexFile(ArrayRef<std::string> SourceFiles,
- const coverage::CoverageMapping &Coverage,
+ const CoverageMapping &Coverage,
const CoverageFiltersMatchAll &Filters) = 0;
/// @}
const CoverageViewOptions &Options;
/// Complete coverage information about the source on display.
- coverage::CoverageData CoverageInfo;
+ CoverageData CoverageInfo;
/// A container for all expansions (e.g macros) in the source on display.
std::vector<ExpansionView> ExpansionSubViews;
LineRef(StringRef Line, int64_t LineNo) : Line(Line), LineNo(LineNo) {}
};
- using CoverageSegmentArray = ArrayRef<const coverage::CoverageSegment *>;
+ using CoverageSegmentArray = ArrayRef<const CoverageSegment *>;
/// @name Rendering Interface
/// @{
SourceCoverageView(StringRef SourceName, const MemoryBuffer &File,
const CoverageViewOptions &Options,
- coverage::CoverageData &&CoverageInfo)
+ CoverageData &&CoverageInfo)
: SourceName(SourceName), File(File), Options(Options),
CoverageInfo(std::move(CoverageInfo)) {}
public:
static std::unique_ptr<SourceCoverageView>
create(StringRef SourceName, const MemoryBuffer &File,
- const CoverageViewOptions &Options,
- coverage::CoverageData &&CoverageInfo);
+ const CoverageViewOptions &Options, CoverageData &&CoverageInfo);
virtual ~SourceCoverageView() {}
const CoverageViewOptions &getOptions() const { return Options; }
/// \brief Add an expansion subview to this view.
- void addExpansion(const coverage::CounterMappingRegion &Region,
+ void addExpansion(const CounterMappingRegion &Region,
std::unique_ptr<SourceCoverageView> View);
/// \brief Add a function instantiation subview to this view.
}
Error CoveragePrinterHTML::createIndexFile(
- ArrayRef<std::string> SourceFiles,
- const coverage::CoverageMapping &Coverage,
+ ArrayRef<std::string> SourceFiles, const CoverageMapping &Coverage,
const CoverageFiltersMatchAll &Filters) {
// Emit the default stylesheet.
auto CSSOrErr = createOutputStream("style", "css", /*InToplevel=*/true);
return tag("span", Snippet, Color.getValue());
};
- auto CheckIfUncovered = [](const coverage::CoverageSegment *S) {
+ auto CheckIfUncovered = [](const CoverageSegment *S) {
return S && S->HasCount && S->Count == 0;
};
namespace llvm {
+using namespace coverage;
+
struct FileCoverageSummary;
/// \brief A coverage printer for html output.
}
Error CoveragePrinterText::createIndexFile(
- ArrayRef<std::string> SourceFiles,
- const coverage::CoverageMapping &Coverage,
+ ArrayRef<std::string> SourceFiles, const CoverageMapping &Coverage,
const CoverageFiltersMatchAll &Filters) {
auto OSOrErr = createOutputStream("index", "txt", /*InToplevel=*/true);
if (Error E = OSOrErr.takeError())
namespace llvm {
+using namespace coverage;
+
/// \brief A coverage printer for text output.
class CoveragePrinterText : public CoveragePrinter {
public:
void closeViewFile(OwnedStream OS) override;
Error createIndexFile(ArrayRef<std::string> SourceFiles,
- const coverage::CoverageMapping &Coverage,
+ const CoverageMapping &Coverage,
const CoverageFiltersMatchAll &Filters) override;
CoveragePrinterText(const CoverageViewOptions &Opts)
public:
SourceCoverageViewText(StringRef SourceName, const MemoryBuffer &File,
const CoverageViewOptions &Options,
- coverage::CoverageData &&CoverageInfo)
+ CoverageData &&CoverageInfo)
: SourceCoverageView(SourceName, File, Options, std::move(CoverageInfo)) {
}
};