2014-08-23 06:56:03 +08:00
|
|
|
//===- CoverageViewOptions.h - Code coverage display options -------------===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2014-08-23 06:56:03 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_COV_COVERAGEVIEWOPTIONS_H
|
|
|
|
#define LLVM_COV_COVERAGEVIEWOPTIONS_H
|
|
|
|
|
2018-04-26 02:34:00 +08:00
|
|
|
#include "llvm/Config/llvm-config.h"
|
2014-08-23 06:56:03 +08:00
|
|
|
#include "RenderingSupport.h"
|
2016-07-16 06:44:57 +08:00
|
|
|
#include <vector>
|
2014-08-23 06:56:03 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// The options for displaying the code coverage information.
|
2014-08-23 06:56:03 +08:00
|
|
|
struct CoverageViewOptions {
|
2016-06-28 08:15:54 +08:00
|
|
|
enum class OutputFormat {
|
2016-07-07 05:44:05 +08:00
|
|
|
Text,
|
2018-11-10 00:10:44 +08:00
|
|
|
HTML,
|
|
|
|
Lcov
|
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 ShowExpandedRegions;
|
|
|
|
bool ShowFunctionInstantiations;
|
2015-09-15 07:26:36 +08:00
|
|
|
bool ShowFullFilenames;
|
2017-09-12 06:56:20 +08:00
|
|
|
bool ShowRegionSummary;
|
|
|
|
bool ShowInstantiationSummary;
|
2017-12-12 07:17:46 +08:00
|
|
|
bool ExportSummaryOnly;
|
2019-03-15 01:49:27 +08:00
|
|
|
bool SkipExpansions;
|
|
|
|
bool SkipFunctions;
|
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;
|
2018-01-06 00:15:07 +08:00
|
|
|
unsigned NumThreads;
|
2014-08-23 06:56:03 +08:00
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Change the output's stream color if the colors are enabled.
|
2014-08-23 06:56:03 +08:00
|
|
|
ColoredRawOstream colored_ostream(raw_ostream &OS,
|
2019-08-02 15:22:34 +08:00
|
|
|
raw_ostream::Colors Color) const {
|
2014-08-23 06:56:03 +08:00
|
|
|
return llvm::colored_ostream(OS, Color, Colors);
|
|
|
|
}
|
2016-06-29 00:12:12 +08:00
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// 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
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Check if a demangler has been specified.
|
2016-07-16 06:44:57 +08:00
|
|
|
bool hasDemangler() const { return !DemanglerOpts.empty(); }
|
2016-08-24 22:27:23 +08:00
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Check if a project title has been specified.
|
2016-08-24 22:27:23 +08:00
|
|
|
bool hasProjectTitle() const { return !ProjectTitle.empty(); }
|
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Check if the created time of the profile data file is available.
|
2016-08-24 22:27:23 +08:00
|
|
|
bool hasCreatedTime() const { return !CreatedTimeStr.empty(); }
|
2016-09-13 19:28:31 +08:00
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Get the LLVM version string.
|
2016-09-13 19:28:31 +08:00
|
|
|
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
|