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
{
31 bool ShowRegionMarkers
;
32 bool ShowExpandedRegions
;
33 bool ShowFunctionInstantiations
;
34 bool ShowFullFilenames
;
35 bool ShowRegionSummary
;
36 bool ShowInstantiationSummary
;
37 bool ExportSummaryOnly
;
39 std::string ShowOutputDirectory
;
40 std::vector
<std::string
> DemanglerOpts
;
42 std::string ProjectTitle
;
43 std::string CreatedTimeStr
;
46 /// Change the output's stream color if the colors are enabled.
47 ColoredRawOstream
colored_ostream(raw_ostream
&OS
,
48 raw_ostream::Colors Color
) const {
49 return llvm::colored_ostream(OS
, Color
, Colors
);
52 /// Check if an output directory has been specified.
53 bool hasOutputDirectory() const { return !ShowOutputDirectory
.empty(); }
55 /// Check if a demangler has been specified.
56 bool hasDemangler() const { return !DemanglerOpts
.empty(); }
58 /// Check if a project title has been specified.
59 bool hasProjectTitle() const { return !ProjectTitle
.empty(); }
61 /// Check if the created time of the profile data file is available.
62 bool hasCreatedTime() const { return !CreatedTimeStr
.empty(); }
64 /// Get the LLVM version string.
65 std::string
getLLVMVersionString() const {
66 std::string VersionString
= "Generated by llvm-cov -- llvm version ";
67 VersionString
+= LLVM_VERSION_STRING
;
73 #endif // LLVM_COV_COVERAGEVIEWOPTIONS_H