blob: ff23a619fdeae5de8be5ff5807b41cc8b9a8cf18 [file] [log] [blame]
Alex Lorenze82d89c2014-08-22 22:56:03 +00001//===- 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
15namespace llvm {
16
17/// \brief The options for displaying the code coverage information.
18struct CoverageViewOptions {
Vedant Kumar635c83c2016-06-28 00:15:54 +000019 enum class OutputFormat {
20 Text
21 };
22
Alex Lorenze82d89c2014-08-22 22:56:03 +000023 bool Debug;
24 bool Colors;
25 bool ShowLineNumbers;
26 bool ShowLineStats;
27 bool ShowRegionMarkers;
28 bool ShowLineStatsOrRegionMarkers;
29 bool ShowExpandedRegions;
30 bool ShowFunctionInstantiations;
Vedant Kumarc3c39e72015-09-14 23:26:36 +000031 bool ShowFullFilenames;
Vedant Kumar635c83c2016-06-28 00:15:54 +000032 OutputFormat ShowFormat;
Vedant Kumar7937ef32016-06-28 02:09:39 +000033 std::string ShowOutputDirectory;
Alex Lorenze82d89c2014-08-22 22:56:03 +000034
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 Kumarde717e62016-06-28 16:12:12 +000040
41 /// \brief Check if an output directory has been specified.
42 bool hasOutputDirectory() const { return ShowOutputDirectory != ""; }
Alex Lorenze82d89c2014-08-22 22:56:03 +000043};
44}
45
46#endif // LLVM_COV_COVERAGEVIEWOPTIONS_H