1 //===- CoverageViewOptions.h - Code coverage display options -------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_COV_COVERAGEVIEWOPTIONS_H
11 #define LLVM_COV_COVERAGEVIEWOPTIONS_H
13 #include "RenderingSupport.h"
18 /// \brief The options for displaying the code coverage information.
19 struct CoverageViewOptions {
20 enum class OutputFormat {
29 bool ShowRegionMarkers;
30 bool ShowLineStatsOrRegionMarkers;
31 bool ShowExpandedRegions;
32 bool ShowFunctionInstantiations;
33 bool ShowFullFilenames;
35 std::string ShowOutputDirectory;
36 std::vector<std::string> DemanglerOpts;
38 std::string ProjectTitle;
39 std::string CreatedTimeStr;
41 /// \brief Change the output's stream color if the colors are enabled.
42 ColoredRawOstream colored_ostream(raw_ostream &OS,
43 raw_ostream::Colors Color) const {
44 return llvm::colored_ostream(OS, Color, Colors);
47 /// \brief Check if an output directory has been specified.
48 bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }
50 /// \brief Check if a demangler has been specified.
51 bool hasDemangler() const { return !DemanglerOpts.empty(); }
53 /// \brief Check if a project title has been specified.
54 bool hasProjectTitle() const { return !ProjectTitle.empty(); }
56 /// \brief Check if the created time of the profile data file is available.
57 bool hasCreatedTime() const { return !CreatedTimeStr.empty(); }
59 /// \brief Get the LLVM version string.
60 std::string getLLVMVersionString() const {
61 std::string VersionString = "Generated by llvm-cov -- llvm version ";
62 VersionString += LLVM_VERSION_STRING;
68 #endif // LLVM_COV_COVERAGEVIEWOPTIONS_H