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" |
| 14 | |
| 15 | namespace llvm { |
| 16 | |
| 17 | /// \brief The options for displaying the code coverage information. |
| 18 | struct CoverageViewOptions { |
Vedant Kumar | 635c83c | 2016-06-28 00:15:54 +0000 | [diff] [blame] | 19 | enum class OutputFormat { |
| 20 | Text |
| 21 | }; |
| 22 | |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 23 | bool Debug; |
| 24 | bool Colors; |
| 25 | bool ShowLineNumbers; |
| 26 | bool ShowLineStats; |
| 27 | bool ShowRegionMarkers; |
| 28 | bool ShowLineStatsOrRegionMarkers; |
| 29 | bool ShowExpandedRegions; |
| 30 | bool ShowFunctionInstantiations; |
Vedant Kumar | c3c39e7 | 2015-09-14 23:26:36 +0000 | [diff] [blame] | 31 | bool ShowFullFilenames; |
Vedant Kumar | 635c83c | 2016-06-28 00:15:54 +0000 | [diff] [blame] | 32 | OutputFormat ShowFormat; |
Vedant Kumar | 7937ef3 | 2016-06-28 02:09:39 +0000 | [diff] [blame] | 33 | std::string ShowOutputDirectory; |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 34 | |
| 35 | /// \brief Change the output's stream color if the colors are enabled. |
| 36 | ColoredRawOstream colored_ostream(raw_ostream &OS, |
| 37 | raw_ostream::Colors Color) const { |
| 38 | return llvm::colored_ostream(OS, Color, Colors); |
| 39 | } |
Vedant Kumar | de717e6 | 2016-06-28 16:12:12 +0000 | [diff] [blame^] | 40 | |
| 41 | /// \brief Check if an output directory has been specified. |
| 42 | bool hasOutputDirectory() const { return ShowOutputDirectory != ""; } |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 43 | }; |
| 44 | } |
| 45 | |
| 46 | #endif // LLVM_COV_COVERAGEVIEWOPTIONS_H |