From: Vedant Kumar Date: Fri, 9 Sep 2016 01:32:51 +0000 (+0000) Subject: [llvm-cov] Constify some methods (NFC) X-Git-Tag: llvmorg-4.0.0-rc1~10261 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aae0ba70604be5e0e1a70c05c80dde8a7590f85b;p=platform%2Fupstream%2Fllvm.git [llvm-cov] Constify some methods (NFC) llvm-svn: 281010 --- diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp index cfcaf2e..b27782b 100644 --- a/llvm/tools/llvm-cov/SourceCoverageView.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp @@ -29,7 +29,8 @@ void CoveragePrinter::StreamDestructor::operator()(raw_ostream *OS) const { } std::string CoveragePrinter::getOutputPath(StringRef Path, StringRef Extension, - bool InToplevel, bool Relative) { + bool InToplevel, + bool Relative) const { assert(Extension.size() && "The file extension may not be empty"); SmallString<256> FullPath; @@ -53,7 +54,7 @@ std::string CoveragePrinter::getOutputPath(StringRef Path, StringRef Extension, Expected CoveragePrinter::createOutputStream(StringRef Path, StringRef Extension, - bool InToplevel) { + bool InToplevel) const { if (!Opts.hasOutputDirectory()) return OwnedStream(&outs()); diff --git a/llvm/tools/llvm-cov/SourceCoverageView.h b/llvm/tools/llvm-cov/SourceCoverageView.h index f2d5d61..3f58937 100644 --- a/llvm/tools/llvm-cov/SourceCoverageView.h +++ b/llvm/tools/llvm-cov/SourceCoverageView.h @@ -115,12 +115,12 @@ protected: /// false, skip the ToplevelDir component. If \p Relative is false, skip the /// OutputDir component. std::string getOutputPath(StringRef Path, StringRef Extension, - bool InToplevel, bool Relative = true); + bool InToplevel, bool Relative = true) const; /// \brief If directory output is enabled, create a file in that directory /// at the path given by getOutputPath(). Otherwise, return stdout. Expected createOutputStream(StringRef Path, StringRef Extension, - bool InToplevel); + bool InToplevel) const; /// \brief Return the sub-directory name for file coverage reports. static StringRef getCoverageDir() { return "coverage"; }