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 "llvm/Config/llvm-config.h"
14 #include "RenderingSupport.h"
19 /// The options for displaying the code coverage information.
20 struct CoverageViewOptions
{
21 enum class OutputFormat
{
30 bool ShowRegionMarkers
;
31 bool ShowExpandedRegions
;
32 bool ShowFunctionInstantiations
;
33 bool ShowFullFilenames
;
34 bool ShowRegionSummary
;
35 bool ShowInstantiationSummary
;
36 bool ExportSummaryOnly
;
38 std::string ShowOutputDirectory
;
39 std::vector
<std::string
> DemanglerOpts
;
41 std::string ProjectTitle
;
42 std::string CreatedTimeStr
;
45 /// Change the output's stream color if the colors are enabled.
46 ColoredRawOstream
colored_ostream(raw_ostream
&OS
,
47 raw_ostream::Colors Color
) const {
48 return llvm::colored_ostream(OS
, Color
, Colors
);
51 /// Check if an output directory has been specified.
52 bool hasOutputDirectory() const { return !ShowOutputDirectory
.empty(); }
54 /// Check if a demangler has been specified.
55 bool hasDemangler() const { return !DemanglerOpts
.empty(); }
57 /// Check if a project title has been specified.
58 bool hasProjectTitle() const { return !ProjectTitle
.empty(); }
60 /// Check if the created time of the profile data file is available.
61 bool hasCreatedTime() const { return !CreatedTimeStr
.empty(); }
63 /// Get the LLVM version string.
64 std::string
getLLVMVersionString() const {
65 std::string VersionString
= "Generated by llvm-cov -- llvm version ";
66 VersionString
+= LLVM_VERSION_STRING
;
72 #endif // LLVM_COV_COVERAGEVIEWOPTIONS_H