From 5674975c5ea3af71a7982a690ebca6a701404b24 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 25 Feb 2015 22:44:50 +0000 Subject: [PATCH] InstrProf: Remove dead code in CoverageMappingReader Remove a default argument that's never passed and a constructor that's never called. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230563 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ProfileData/CoverageMappingReader.h | 5 +---- lib/ProfileData/CoverageMappingReader.cpp | 16 +++------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/include/llvm/ProfileData/CoverageMappingReader.h b/include/llvm/ProfileData/CoverageMappingReader.h index fe567dede94..cd4469c0666 100644 --- a/include/llvm/ProfileData/CoverageMappingReader.h +++ b/include/llvm/ProfileData/CoverageMappingReader.h @@ -185,10 +185,7 @@ private: std::error_code success() { return error(instrprof_error::success); } public: - ObjectFileCoverageMappingReader(StringRef FileName); - ObjectFileCoverageMappingReader( - std::unique_ptr &ObjectBuffer, - sys::fs::file_magic Type = sys::fs::file_magic::unknown); + ObjectFileCoverageMappingReader(std::unique_ptr &ObjectBuffer); std::error_code readHeader(); std::error_code readNextRecord(CoverageMappingRecord &Record) override; diff --git a/lib/ProfileData/CoverageMappingReader.cpp b/lib/ProfileData/CoverageMappingReader.cpp index 42c0f2b0224..f09ddeb37e8 100644 --- a/lib/ProfileData/CoverageMappingReader.cpp +++ b/lib/ProfileData/CoverageMappingReader.cpp @@ -286,16 +286,6 @@ std::error_code RawCoverageMappingReader::read() { return success(); } -ObjectFileCoverageMappingReader::ObjectFileCoverageMappingReader( - StringRef FileName) - : CurrentRecord(0) { - auto File = llvm::object::ObjectFile::createObjectFile(FileName); - if (!File) - error(File.getError()); - else - Object = std::move(File.get()); -} - namespace { /// \brief The coverage mapping data for a single function. /// It points to the function's name. @@ -449,7 +439,7 @@ static std::error_code decodeTestingFormat(StringRef Data, } ObjectFileCoverageMappingReader::ObjectFileCoverageMappingReader( - std::unique_ptr &ObjectBuffer, sys::fs::file_magic Type) + std::unique_ptr &ObjectBuffer) : CurrentRecord(0) { if (ObjectBuffer->getBuffer().startswith(TestingFormatMagic)) { // This is a special format used for testing. @@ -467,8 +457,8 @@ ObjectFileCoverageMappingReader::ObjectFileCoverageMappingReader( return; } - auto File = object::ObjectFile::createObjectFile( - ObjectBuffer->getMemBufferRef(), Type); + auto File = + object::ObjectFile::createObjectFile(ObjectBuffer->getMemBufferRef()); if (!File) error(File.getError()); else -- 2.34.1