2014-08-23 06:56:03 +08:00
|
|
|
//===- CoverageViewOptions.h - Code coverage display options -------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_COV_COVERAGEVIEWOPTIONS_H
|
|
|
|
#define LLVM_COV_COVERAGEVIEWOPTIONS_H
|
|
|
|
|
|
|
|
#include "RenderingSupport.h"
|
2016-07-16 06:44:57 +08:00
|
|
|
#include <vector>
|
2014-08-23 06:56:03 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
/// \brief The options for displaying the code coverage information.
|
|
|
|
struct CoverageViewOptions {
|
2016-06-28 08:15:54 +08:00
|
|
|
enum class OutputFormat {
|
2016-07-07 05:44:05 +08:00
|
|
|
Text,
|
|
|
|
HTML
|
2016-06-28 08:15:54 +08:00
|
|
|
};
|
|
|
|
|
2014-08-23 06:56:03 +08:00
|
|
|
bool Debug;
|
|
|
|
bool Colors;
|
|
|
|
bool ShowLineNumbers;
|
|
|
|
bool ShowLineStats;
|
|
|
|
bool ShowRegionMarkers;
|
|
|
|
bool ShowLineStatsOrRegionMarkers;
|
|
|
|
bool ShowExpandedRegions;
|
|
|
|
bool ShowFunctionInstantiations;
|
2015-09-15 07:26:36 +08:00
|
|
|
bool ShowFullFilenames;
|
2016-06-29 00:12:15 +08:00
|
|
|
OutputFormat Format;
|
2016-06-28 10:09:39 +08:00
|
|
|
std::string ShowOutputDirectory;
|
2016-07-16 06:44:57 +08:00
|
|
|
std::vector<std::string> DemanglerOpts;
|
2016-08-04 18:39:43 +08:00
|
|
|
uint32_t TabSize;
|
2016-08-24 22:27:23 +08:00
|
|
|
std::string ProjectTitle;
|
|
|
|
std::string CreatedTimeStr;
|
2014-08-23 06:56:03 +08:00
|
|
|
|
|
|
|
/// \brief Change the output's stream color if the colors are enabled.
|
|
|
|
ColoredRawOstream colored_ostream(raw_ostream &OS,
|
|
|
|
raw_ostream::Colors Color) const {
|
|
|
|
return llvm::colored_ostream(OS, Color, Colors);
|
|
|
|
}
|
2016-06-29 00:12:12 +08:00
|
|
|
|
|
|
|
/// \brief Check if an output directory has been specified.
|
2016-07-16 06:44:54 +08:00
|
|
|
bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }
|
2016-07-16 06:44:57 +08:00
|
|
|
|
|
|
|
/// \brief Check if a demangler has been specified.
|
|
|
|
bool hasDemangler() const { return !DemanglerOpts.empty(); }
|
2016-08-24 22:27:23 +08:00
|
|
|
|
|
|
|
/// \brief Check if a project title has been specified.
|
|
|
|
bool hasProjectTitle() const { return !ProjectTitle.empty(); }
|
|
|
|
|
|
|
|
/// \brief Check if the created time of the profile data file is available.
|
|
|
|
bool hasCreatedTime() const { return !CreatedTimeStr.empty(); }
|
2016-09-13 19:28:31 +08:00
|
|
|
|
|
|
|
/// \brief Get the LLVM version string.
|
|
|
|
std::string getLLVMVersionString() const {
|
|
|
|
std::string VersionString = "Generated by llvm-cov -- llvm version ";
|
|
|
|
VersionString += LLVM_VERSION_STRING;
|
|
|
|
return VersionString;
|
|
|
|
}
|
2014-08-23 06:56:03 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // LLVM_COV_COVERAGEVIEWOPTIONS_H
|