forked from OSchip/llvm-project
[llvm-cov] Move a check into a helper method (NFC)
llvm-svn: 274025
This commit is contained in:
parent
1c7d532cde
commit
de717e655b
|
@ -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 != ""; }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue