[llvm] r274025 - [llvm-cov] Move a check into a helper method (NFC)
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 28 09:12:13 PDT 2016
Author: vedantk
Date: Tue Jun 28 11:12:12 2016
New Revision: 274025
URL: http://llvm.org/viewvc/llvm-project?rev=274025&view=rev
Log:
[llvm-cov] Move a check into a helper method (NFC)
Modified:
llvm/trunk/tools/llvm-cov/CoverageViewOptions.h
llvm/trunk/tools/llvm-cov/SourceCoverageView.cpp
Modified: llvm/trunk/tools/llvm-cov/CoverageViewOptions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CoverageViewOptions.h?rev=274025&r1=274024&r2=274025&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CoverageViewOptions.h (original)
+++ llvm/trunk/tools/llvm-cov/CoverageViewOptions.h Tue Jun 28 11:12:12 2016
@@ -37,6 +37,9 @@ struct CoverageViewOptions {
raw_ostream::Colors Color) const {
return llvm::colored_ostream(OS, Color, Colors);
}
+
+ /// \brief Check if an output directory has been specified.
+ bool hasOutputDirectory() const { return ShowOutputDirectory != ""; }
};
}
Modified: llvm/trunk/tools/llvm-cov/SourceCoverageView.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/SourceCoverageView.cpp?rev=274025&r1=274024&r2=274025&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/SourceCoverageView.cpp (original)
+++ llvm/trunk/tools/llvm-cov/SourceCoverageView.cpp Tue Jun 28 11:12:12 2016
@@ -74,7 +74,7 @@ Expected<SourceCoverageView::OwnedStream
SourceCoverageView::createOutputStream(const CoverageViewOptions &Opts,
StringRef Path, StringRef Extension,
bool InToplevel) {
- if (Opts.ShowOutputDirectory == "")
+ if (!Opts.hasOutputDirectory())
return OwnedStream(&outs());
return createFileInDirectory(Opts.ShowOutputDirectory,
More information about the llvm-commits
mailing list