Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 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 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef LLVM_COV_COVERAGEVIEWOPTIONS_H |
| 11 | #define LLVM_COV_COVERAGEVIEWOPTIONS_H |
| 12 | |
| 13 | #include "RenderingSupport.h" |
Vedant Kumar | 424f51b | 2016-07-15 22:44:57 +0000 | [diff] [blame] | 14 | #include <vector> |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 15 | |
| 16 | namespace llvm { |
| 17 | |
| 18 | /// \brief The options for displaying the code coverage information. |
| 19 | struct CoverageViewOptions { |
Vedant Kumar | 635c83c | 2016-06-28 00:15:54 +0000 | [diff] [blame] | 20 | enum class OutputFormat { |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 21 | Text, |
| 22 | HTML |
Vedant Kumar | 635c83c | 2016-06-28 00:15:54 +0000 | [diff] [blame] | 23 | }; |
| 24 | |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 25 | bool Debug; |
| 26 | bool Colors; |
| 27 | bool ShowLineNumbers; |
| 28 | bool ShowLineStats; |
| 29 | bool ShowRegionMarkers; |
| 30 | bool ShowLineStatsOrRegionMarkers; |
| 31 | bool ShowExpandedRegions; |
| 32 | bool ShowFunctionInstantiations; |
Vedant Kumar | c3c39e7 | 2015-09-14 23:26:36 +0000 | [diff] [blame] | 33 | bool ShowFullFilenames; |
Vedant Kumar | ebe8401 | 2016-06-28 16:12:15 +0000 | [diff] [blame] | 34 | OutputFormat Format; |
Vedant Kumar | 7937ef3 | 2016-06-28 02:09:39 +0000 | [diff] [blame] | 35 | std::string ShowOutputDirectory; |
Vedant Kumar | 424f51b | 2016-07-15 22:44:57 +0000 | [diff] [blame] | 36 | std::vector<std::string> DemanglerOpts; |
Ying Yi | 0ef31b7 | 2016-08-04 10:39:43 +0000 | [diff] [blame] | 37 | uint32_t TabSize; |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 38 | |
| 39 | /// \brief Change the output's stream color if the colors are enabled. |
| 40 | ColoredRawOstream colored_ostream(raw_ostream &OS, |
| 41 | raw_ostream::Colors Color) const { |
| 42 | return llvm::colored_ostream(OS, Color, Colors); |
| 43 | } |
Vedant Kumar | de717e6 | 2016-06-28 16:12:12 +0000 | [diff] [blame] | 44 | |
| 45 | /// \brief Check if an output directory has been specified. |
Vedant Kumar | 6ab6b36 | 2016-07-15 22:44:54 +0000 | [diff] [blame] | 46 | bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); } |
Vedant Kumar | 424f51b | 2016-07-15 22:44:57 +0000 | [diff] [blame] | 47 | |
| 48 | /// \brief Check if a demangler has been specified. |
| 49 | bool hasDemangler() const { return !DemanglerOpts.empty(); } |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 50 | }; |
| 51 | } |
| 52 | |
| 53 | #endif // LLVM_COV_COVERAGEVIEWOPTIONS_H |