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 15 namespace llvm { 16 17 /// \brief The options for displaying the code coverage information. 18 struct CoverageViewOptions { 19 enum class OutputFormat { 20 Text, 21 HTML 22 }; 23 24 bool Debug; 25 bool Colors; 26 bool ShowLineNumbers; 27 bool ShowLineStats; 28 bool ShowRegionMarkers; 29 bool ShowLineStatsOrRegionMarkers; 30 bool ShowExpandedRegions; 31 bool ShowFunctionInstantiations; 32 bool ShowFullFilenames; 33 OutputFormat Format; 34 std::string ShowOutputDirectory; 35 36 /// \brief Change the output's stream color if the colors are enabled. 37 ColoredRawOstream colored_ostream(raw_ostream &OS, 38 raw_ostream::Colors Color) const { 39 return llvm::colored_ostream(OS, Color, Colors); 40 } 41 42 /// \brief Check if an output directory has been specified. 43 bool hasOutputDirectory() const { return ShowOutputDirectory != ""; } 44 }; 45 } 46 47 #endif // LLVM_COV_COVERAGEVIEWOPTIONS_H 48