blob: 45f2d8139870bf68c53eead60d0324d021a3502d [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"
Vedant Kumar424f51b2016-07-15 22:44:57 +000014#include <vector>
Alex Lorenze82d89c2014-08-22 22:56:03 +000015
16namespace llvm {
17
18/// \brief The options for displaying the code coverage information.
19struct CoverageViewOptions {
Vedant Kumar635c83c2016-06-28 00:15:54 +000020 enum class OutputFormat {
Vedant Kumar4c010922016-07-06 21:44:05 +000021 Text,
22 HTML
Vedant Kumar635c83c2016-06-28 00:15:54 +000023 };
24
Alex Lorenze82d89c2014-08-22 22:56:03 +000025 bool Debug;
26 bool Colors;
27 bool ShowLineNumbers;
28 bool ShowLineStats;
29 bool ShowRegionMarkers;
30 bool ShowLineStatsOrRegionMarkers;
31 bool ShowExpandedRegions;
32 bool ShowFunctionInstantiations;
Vedant Kumarc3c39e72015-09-14 23:26:36 +000033 bool ShowFullFilenames;
Vedant Kumarebe84012016-06-28 16:12:15 +000034 OutputFormat Format;
Vedant Kumar7937ef32016-06-28 02:09:39 +000035 std::string ShowOutputDirectory;
Vedant Kumar424f51b2016-07-15 22:44:57 +000036 std::vector<std::string> DemanglerOpts;
Ying Yi0ef31b72016-08-04 10:39:43 +000037 uint32_t TabSize;
Alex Lorenze82d89c2014-08-22 22:56:03 +000038
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 Kumarde717e62016-06-28 16:12:12 +000044
45 /// \brief Check if an output directory has been specified.
Vedant Kumar6ab6b362016-07-15 22:44:54 +000046 bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }
Vedant Kumar424f51b2016-07-15 22:44:57 +000047
48 /// \brief Check if a demangler has been specified.
49 bool hasDemangler() const { return !DemanglerOpts.empty(); }
Alex Lorenze82d89c2014-08-22 22:56:03 +000050};
51}
52
53#endif // LLVM_COV_COVERAGEVIEWOPTIONS_H