Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/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
  OutputFormat Format;
36
  std::string ShowOutputDirectory;
37
  std::vector<std::string> DemanglerOpts;
38
  uint32_t TabSize;
39
  std::string ProjectTitle;
40
  std::string CreatedTimeStr;
41
42
  /// \brief Change the output's stream color if the colors are enabled.
43
  ColoredRawOstream colored_ostream(raw_ostream &OS,
44
462
                                    raw_ostream::Colors Color) const {
45
462
    return llvm::colored_ostream(OS, Color, Colors);
46
462
  }
47
48
  /// \brief Check if an output directory has been specified.
49
366
  bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }
50
51
  /// \brief Check if a demangler has been specified.
52
85
  bool hasDemangler() const { return !DemanglerOpts.empty(); }
53
54
  /// \brief Check if a project title has been specified.
55
42
  bool hasProjectTitle() const { return !ProjectTitle.empty(); }
56
57
  /// \brief Check if the created time of the profile data file is available.
58
42
  bool hasCreatedTime() const { return !CreatedTimeStr.empty(); }
59
60
  /// \brief Get the LLVM version string.
61
24
  std::string getLLVMVersionString() const {
62
24
    std::string VersionString = "Generated by llvm-cov -- llvm version ";
63
24
    VersionString += LLVM_VERSION_STRING;
64
24
    return VersionString;
65
24
  }
66
};
67
}
68
69
#endif // LLVM_COV_COVERAGEVIEWOPTIONS_H