diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h --- a/llvm/include/llvm/ProfileData/SampleProf.h +++ b/llvm/include/llvm/ProfileData/SampleProf.h @@ -46,7 +46,6 @@ success = 0, bad_magic, unsupported_version, - too_large, truncated, malformed, unrecognized_format, diff --git a/llvm/lib/ProfileData/SampleProf.cpp b/llvm/lib/ProfileData/SampleProf.cpp --- a/llvm/lib/ProfileData/SampleProf.cpp +++ b/llvm/lib/ProfileData/SampleProf.cpp @@ -70,8 +70,6 @@ return "Invalid sample profile data (bad magic)"; case sampleprof_error::unsupported_version: return "Unsupported sample profile format version"; - case sampleprof_error::too_large: - return "Too much profile data"; case sampleprof_error::truncated: return "Truncated profile data"; case sampleprof_error::malformed: diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp --- a/llvm/lib/ProfileData/SampleProfReader.cpp +++ b/llvm/lib/ProfileData/SampleProfReader.cpp @@ -1761,16 +1761,7 @@ /// \returns an error code indicating the status of the buffer. static ErrorOr> setupMemoryBuffer(const Twine &Filename) { - auto BufferOrErr = MemoryBuffer::getFileOrSTDIN(Filename, /*IsText=*/true); - if (std::error_code EC = BufferOrErr.getError()) - return EC; - auto Buffer = std::move(BufferOrErr.get()); - - // Check the file. - if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits::max()) - return sampleprof_error::too_large; - - return std::move(Buffer); + return MemoryBuffer::getFileOrSTDIN(Filename, /*IsText=*/true); } /// Create a sample profile reader based on the format of the input file.