77
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 //===- CoverageViewOptions.h - Code coverage display options -------------===//
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 // The LLVM Compiler Infrastructure
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 // This file is distributed under the University of Illinois Open Source
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 // License. See LICENSE.TXT for details.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 //===----------------------------------------------------------------------===//
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 #ifndef LLVM_COV_COVERAGEVIEWOPTIONS_H
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 #define LLVM_COV_COVERAGEVIEWOPTIONS_H
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 #include "RenderingSupport.h"
|
120
|
14 #include <vector>
|
77
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 namespace llvm {
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 /// \brief The options for displaying the code coverage information.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 struct CoverageViewOptions {
|
120
|
20 enum class OutputFormat {
|
|
21 Text,
|
|
22 HTML
|
|
23 };
|
|
24
|
77
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 bool Debug;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 bool Colors;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 bool ShowLineNumbers;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 bool ShowLineStats;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 bool ShowRegionMarkers;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 bool ShowExpandedRegions;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 bool ShowFunctionInstantiations;
|
95
|
32 bool ShowFullFilenames;
|
121
|
33 bool ShowRegionSummary;
|
|
34 bool ShowInstantiationSummary;
|
120
|
35 OutputFormat Format;
|
|
36 std::string ShowOutputDirectory;
|
|
37 std::vector<std::string> DemanglerOpts;
|
|
38 uint32_t TabSize;
|
|
39 std::string ProjectTitle;
|
|
40 std::string CreatedTimeStr;
|
77
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 /// \brief Change the output's stream color if the colors are enabled.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 ColoredRawOstream colored_ostream(raw_ostream &OS,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 raw_ostream::Colors Color) const {
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 return llvm::colored_ostream(OS, Color, Colors);
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 }
|
120
|
47
|
|
48 /// \brief Check if an output directory has been specified.
|
|
49 bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }
|
|
50
|
|
51 /// \brief Check if a demangler has been specified.
|
|
52 bool hasDemangler() const { return !DemanglerOpts.empty(); }
|
|
53
|
|
54 /// \brief Check if a project title has been specified.
|
|
55 bool hasProjectTitle() const { return !ProjectTitle.empty(); }
|
|
56
|
|
57 /// \brief Check if the created time of the profile data file is available.
|
|
58 bool hasCreatedTime() const { return !CreatedTimeStr.empty(); }
|
|
59
|
|
60 /// \brief Get the LLVM version string.
|
|
61 std::string getLLVMVersionString() const {
|
|
62 std::string VersionString = "Generated by llvm-cov -- llvm version ";
|
|
63 VersionString += LLVM_VERSION_STRING;
|
|
64 return VersionString;
|
|
65 }
|
77
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 };
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 #endif // LLVM_COV_COVERAGEVIEWOPTIONS_H
|