CoverageViewOptions.h revision 309124
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#include <vector>
15
16namespace llvm {
17
18/// \brief The options for displaying the code coverage information.
19struct CoverageViewOptions {
20  enum class OutputFormat {
21    Text,
22    HTML
23  };
24
25  bool Debug;
26  bool Colors;
27  bool ShowLineNumbers;
28  bool ShowLineStats;
29  bool ShowRegionMarkers;
30  bool ShowLineStatsOrRegionMarkers;
31  bool ShowExpandedRegions;
32  bool ShowFunctionInstantiations;
33  bool ShowFullFilenames;
34  OutputFormat Format;
35  std::string ShowOutputDirectory;
36  std::vector<std::string> DemanglerOpts;
37
38  /// \brief Change the output's stream color if the colors are enabled.
39  ColoredRawOstream colored_ostream(raw_ostream &OS,
40                                    raw_ostream::Colors Color) const {
41    return llvm::colored_ostream(OS, Color, Colors);
42  }
43
44  /// \brief Check if an output directory has been specified.
45  bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }
46
47  /// \brief Check if a demangler has been specified.
48  bool hasDemangler() const { return !DemanglerOpts.empty(); }
49};
50}
51
52#endif // LLVM_COV_COVERAGEVIEWOPTIONS_H
53