diff options
author | Vedant Kumar <vsk@apple.com> | 2016-06-28 01:14:04 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-06-28 01:14:04 +0000 |
commit | a48d9fe86a627c88a21398db6c18a0108b131444 (patch) | |
tree | eb42ea5f99f9d039d568e5933f529d535ce6d6c4 /llvm/tools/llvm-cov/SourceCoverageView.cpp | |
parent | b4d95031711e65da8e0f87e8b4d9b8daf69dad00 (diff) | |
download | bcm5719-llvm-a48d9fe86a627c88a21398db6c18a0108b131444.tar.gz bcm5719-llvm-a48d9fe86a627c88a21398db6c18a0108b131444.zip |
Revert "[llvm-cov] Add an -output-dir option for the show sub-command"
This reverts commit r273971. test/profile/instrprof-visibility.cpp is
failing because of an uncaught error in SafelyCloseFileDescriptor.
llvm-svn: 273978
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageView.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageView.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp index 097d01b9643..3309189a935 100644 --- a/llvm/tools/llvm-cov/SourceCoverageView.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp @@ -15,9 +15,7 @@ #include "SourceCoverageViewText.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/Support/FileSystem.h" #include "llvm/Support/LineIterator.h" -#include "llvm/Support/Path.h" using namespace llvm; @@ -36,49 +34,6 @@ std::string SourceCoverageView::formatCount(uint64_t N) { return Result; } -/// \brief Create a file at ``Dir/ToplevelDir/@Path.Extension``. If -/// \p ToplevelDir is empty, its path component is skipped. -static Expected<std::unique_ptr<raw_ostream>> -createFileInDirectory(StringRef Dir, StringRef ToplevelDir, StringRef Path, - StringRef Extension) { - assert(Extension.size() && "The file extension may not be empty"); - - SmallString<256> FullPath(Dir); - if (!ToplevelDir.empty()) - sys::path::append(FullPath, ToplevelDir); - - auto PathBaseDir = sys::path::relative_path(sys::path::parent_path(Path)); - sys::path::append(FullPath, PathBaseDir); - - if (auto E = sys::fs::create_directories(FullPath)) - return errorCodeToError(E); - - auto PathFilename = (sys::path::filename(Path) + "." + Extension).str(); - sys::path::append(FullPath, PathFilename); - - std::error_code E; - auto OS = llvm::make_unique<raw_fd_ostream>(FullPath, E, sys::fs::F_RW); - if (E) - return errorCodeToError(E); - return std::move(OS); -} - -Expected<std::unique_ptr<raw_ostream>> -SourceCoverageView::createOutputStream(const CoverageViewOptions &Opts, - StringRef Path, StringRef Extension, - bool InToplevel) { - if (Opts.ShowOutputDirectory == "") { - std::error_code E; - auto OS = llvm::make_unique<raw_fd_ostream>("-", E, sys::fs::F_None); - if (E) - return errorCodeToError(E); - return std::move(OS); - } - - return createFileInDirectory(Opts.ShowOutputDirectory, - InToplevel ? "" : "coverage", Path, Extension); -} - void SourceCoverageView::addExpansion( const coverage::CounterMappingRegion &Region, std::unique_ptr<SourceCoverageView> View) { |