2014-08-23 00:56:03 +02:00
|
|
|
//===- CoverageViewOptions.h - Code coverage display options -------------===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01: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 00:56:03 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_COV_COVERAGEVIEWOPTIONS_H
|
|
|
|
#define LLVM_COV_COVERAGEVIEWOPTIONS_H
|
|
|
|
|
2018-04-25 20:34:00 +02:00
|
|
|
#include "llvm/Config/llvm-config.h"
|
2014-08-23 00:56:03 +02:00
|
|
|
#include "RenderingSupport.h"
|
2016-07-16 00:44:57 +02:00
|
|
|
#include <vector>
|
2014-08-23 00:56:03 +02:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// The options for displaying the code coverage information.
|
2014-08-23 00:56:03 +02:00
|
|
|
struct CoverageViewOptions {
|
2016-06-28 02:15:54 +02:00
|
|
|
enum class OutputFormat {
|
2016-07-06 23:44:05 +02:00
|
|
|
Text,
|
2018-11-09 17:10:44 +01:00
|
|
|
HTML,
|
|
|
|
Lcov
|
2016-06-28 02:15:54 +02:00
|
|
|
};
|
|
|
|
|
2020-12-28 18:20:48 +01:00
|
|
|
enum class BranchOutputType { Count, Percent, Off };
|
|
|
|
|
2014-08-23 00:56:03 +02:00
|
|
|
bool Debug;
|
|
|
|
bool Colors;
|
|
|
|
bool ShowLineNumbers;
|
|
|
|
bool ShowLineStats;
|
|
|
|
bool ShowRegionMarkers;
|
2020-12-28 18:20:48 +01:00
|
|
|
bool ShowBranchCounts;
|
|
|
|
bool ShowBranchPercents;
|
2014-08-23 00:56:03 +02:00
|
|
|
bool ShowExpandedRegions;
|
|
|
|
bool ShowFunctionInstantiations;
|
2015-09-15 01:26:36 +02:00
|
|
|
bool ShowFullFilenames;
|
2020-12-28 18:20:48 +01:00
|
|
|
bool ShowBranchSummary;
|
2017-09-12 00:56:20 +02:00
|
|
|
bool ShowRegionSummary;
|
|
|
|
bool ShowInstantiationSummary;
|
2017-12-12 00:17:46 +01:00
|
|
|
bool ExportSummaryOnly;
|
2019-03-14 18:49:27 +01:00
|
|
|
bool SkipExpansions;
|
|
|
|
bool SkipFunctions;
|
2016-06-28 18:12:15 +02:00
|
|
|
OutputFormat Format;
|
2020-12-28 18:20:48 +01:00
|
|
|
BranchOutputType ShowBranches;
|
2016-06-28 04:09:39 +02:00
|
|
|
std::string ShowOutputDirectory;
|
2016-07-16 00:44:57 +02:00
|
|
|
std::vector<std::string> DemanglerOpts;
|
2016-08-04 12:39:43 +02:00
|
|
|
uint32_t TabSize;
|
2016-08-24 16:27:23 +02:00
|
|
|
std::string ProjectTitle;
|
|
|
|
std::string CreatedTimeStr;
|
2018-01-05 17:15:07 +01:00
|
|
|
unsigned NumThreads;
|
2021-04-09 20:53:59 +02:00
|
|
|
std::string CompilationDirectory;
|
2014-08-23 00:56:03 +02:00
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Change the output's stream color if the colors are enabled.
|
2014-08-23 00:56:03 +02:00
|
|
|
ColoredRawOstream colored_ostream(raw_ostream &OS,
|
2019-08-02 09:22:34 +02:00
|
|
|
raw_ostream::Colors Color) const {
|
2014-08-23 00:56:03 +02:00
|
|
|
return llvm::colored_ostream(OS, Color, Colors);
|
|
|
|
}
|
2016-06-28 18:12:12 +02:00
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Check if an output directory has been specified.
|
2016-07-16 00:44:54 +02:00
|
|
|
bool hasOutputDirectory() const { return !ShowOutputDirectory.empty(); }
|
2016-07-16 00:44:57 +02:00
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Check if a demangler has been specified.
|
2016-07-16 00:44:57 +02:00
|
|
|
bool hasDemangler() const { return !DemanglerOpts.empty(); }
|
2016-08-24 16:27:23 +02:00
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Check if a project title has been specified.
|
2016-08-24 16:27:23 +02:00
|
|
|
bool hasProjectTitle() const { return !ProjectTitle.empty(); }
|
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Check if the created time of the profile data file is available.
|
2016-08-24 16:27:23 +02:00
|
|
|
bool hasCreatedTime() const { return !CreatedTimeStr.empty(); }
|
2016-09-13 13:28:31 +02:00
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Get the LLVM version string.
|
2016-09-13 13:28:31 +02:00
|
|
|
std::string getLLVMVersionString() const {
|
|
|
|
std::string VersionString = "Generated by llvm-cov -- llvm version ";
|
|
|
|
VersionString += LLVM_VERSION_STRING;
|
|
|
|
return VersionString;
|
|
|
|
}
|
2014-08-23 00:56:03 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // LLVM_COV_COVERAGEVIEWOPTIONS_H
|