[TextAPI] Remove a superfluous semicolon, fixing GCC warnings. NFC.
[llvm-core.git] / tools / llvm-cov / CoverageViewOptions.h
blobc8a47286002794aa509582031c2fdc1e1708b937
1 //===- CoverageViewOptions.h - Code coverage display options -------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_COV_COVERAGEVIEWOPTIONS_H
11 #define LLVM_COV_COVERAGEVIEWOPTIONS_H
13 #include "llvm/Config/llvm-config.h"
14 #include "RenderingSupport.h"
15 #include <vector>
17 namespace llvm {
19 /// The options for displaying the code coverage information.
20 struct CoverageViewOptions {
21 enum class OutputFormat {
22 Text,
23 HTML,
24 Lcov
27 bool Debug;
28 bool Colors;
29 bool ShowLineNumbers;
30 bool ShowLineStats;
31 bool ShowRegionMarkers;
32 bool ShowExpandedRegions;
33 bool ShowFunctionInstantiations;
34 bool ShowFullFilenames;
35 bool ShowRegionSummary;
36 bool ShowInstantiationSummary;
37 bool ExportSummaryOnly;
38 OutputFormat Format;
39 std::string ShowOutputDirectory;
40 std::vector<std::string> DemanglerOpts;
41 uint32_t TabSize;
42 std::string ProjectTitle;
43 std::string CreatedTimeStr;
44 unsigned NumThreads;
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;
68 return VersionString;
73 #endif // LLVM_COV_COVERAGEVIEWOPTIONS_H