Coverage Report

Created: 2018-01-17 21:32

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/llvm-cov/CoverageViewOptions.h
Line
Count
Source
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
16
namespace llvm {
17
18
/// \brief The options for displaying the code coverage information.
19
struct 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 ShowExpandedRegions;
31
  bool ShowFunctionInstantiations;
32
  bool ShowFullFilenames;
33
  bool ShowRegionSummary;
34
  bool ShowInstantiationSummary;
35
  bool ExportSummaryOnly;
36
  OutputFormat Format;
37
  std::string ShowOutputDirectory;
38
  std::vector<std::string> DemanglerOpts;
39
  uint32_t TabSize;
40
  std::string ProjectTitle;
41
  std::string CreatedTimeStr;
42
  unsigned NumThreads;
43
44
  /// \brief Change the output's stream color if the colors are enabled.
45
  ColoredRawOstream colored_ostream(raw_ostream &OS,
46
382
                                    raw_ostream::Colors Color) const {
47
382
    return llvm::colored_ostream(OS, Color, Colors);
48
382
  }
49
50
  /// \brief Check if an output directory has been specified.
51
319
  bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }
52
53
  /// \brief Check if a demangler has been specified.
54
58
  bool hasDemangler() const { return !DemanglerOpts.empty(); }
55
56
  /// \brief Check if a project title has been specified.
57
40
  bool hasProjectTitle() const { return !ProjectTitle.empty(); }
58
59
  /// \brief Check if the created time of the profile data file is available.
60
40
  bool hasCreatedTime() const { return !CreatedTimeStr.empty(); }
61
62
  /// \brief Get the LLVM version string.
63
16
  std::string getLLVMVersionString() const {
64
16
    std::string VersionString = "Generated by llvm-cov -- llvm version ";
65
16
    VersionString += LLVM_VERSION_STRING;
66
16
    return VersionString;
67
16
  }
68
};
69
}
70
71
#endif // LLVM_COV_COVERAGEVIEWOPTIONS_H