Path: blob/main/contrib/llvm-project/llvm/tools/llvm-cov/CoverageViewOptions.h
35231 views
//===- CoverageViewOptions.h - Code coverage display options -------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_COV_COVERAGEVIEWOPTIONS_H9#define LLVM_COV_COVERAGEVIEWOPTIONS_H1011#include "llvm/Config/llvm-config.h"12#include "RenderingSupport.h"13#include <vector>1415namespace llvm {1617/// The options for displaying the code coverage information.18struct CoverageViewOptions {19enum class OutputFormat {20Text,21HTML,22Lcov23};2425enum class BranchOutputType { Count, Percent, Off };2627bool Debug;28bool Colors;29bool ShowLineNumbers;30bool ShowLineStats;31bool ShowRegionMarkers;32bool ShowMCDC;33bool ShowBranchCounts;34bool ShowBranchPercents;35bool ShowExpandedRegions;36bool ShowFunctionInstantiations;37bool ShowFullFilenames;38bool ShowBranchSummary;39bool ShowMCDCSummary;40bool ShowRegionSummary;41bool ShowInstantiationSummary;42bool ShowDirectoryCoverage;43bool ExportSummaryOnly;44bool SkipExpansions;45bool SkipFunctions;46bool SkipBranches;47OutputFormat Format;48BranchOutputType ShowBranches;49std::string ShowOutputDirectory;50std::vector<std::string> DemanglerOpts;51uint32_t TabSize;52std::string ProjectTitle;53std::string CreatedTimeStr;54unsigned NumThreads;55std::string CompilationDirectory;56float HighCovWatermark;57float LowCovWatermark;5859/// Change the output's stream color if the colors are enabled.60ColoredRawOstream colored_ostream(raw_ostream &OS,61raw_ostream::Colors Color) const {62return llvm::colored_ostream(OS, Color, Colors);63}6465/// Check if an output directory has been specified.66bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }6768/// Check if a demangler has been specified.69bool hasDemangler() const { return !DemanglerOpts.empty(); }7071/// Check if a project title has been specified.72bool hasProjectTitle() const { return !ProjectTitle.empty(); }7374/// Check if the created time of the profile data file is available.75bool hasCreatedTime() const { return !CreatedTimeStr.empty(); }7677/// Get the LLVM version string.78std::string getLLVMVersionString() const {79std::string VersionString = "Generated by llvm-cov -- llvm version ";80VersionString += LLVM_VERSION_STRING;81return VersionString;82}83};84}8586#endif // LLVM_COV_COVERAGEVIEWOPTIONS_H878889