From: Justin Bogner Date: Wed, 25 Feb 2015 22:44:50 +0000 (+0000) Subject: InstrProf: Remove dead code in CoverageMappingReader X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3588686baf06f622b000a4fd68ec826dc1f64353;p=platform%2Fupstream%2Fllvm.git InstrProf: Remove dead code in CoverageMappingReader Remove a default argument that's never passed and a constructor that's never called. llvm-svn: 230563 --- diff --git a/llvm/include/llvm/ProfileData/CoverageMappingReader.h b/llvm/include/llvm/ProfileData/CoverageMappingReader.h index fe567de..cd4469c 100644 --- a/llvm/include/llvm/ProfileData/CoverageMappingReader.h +++ b/llvm/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/llvm/lib/ProfileData/CoverageMappingReader.cpp b/llvm/lib/ProfileData/CoverageMappingReader.cpp index 42c0f2b..f09ddeb 100644 --- a/llvm/lib/ProfileData/CoverageMappingReader.cpp +++ b/llvm/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