summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData/SampleProfReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ProfileData/SampleProfReader.cpp')
-rw-r--r--llvm/lib/ProfileData/SampleProfReader.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index 0bed4f09f1f..a5d00083b53 100644
--- a/llvm/lib/ProfileData/SampleProfReader.cpp
+++ b/llvm/lib/ProfileData/SampleProfReader.cpp
@@ -222,22 +222,6 @@ std::error_code SampleProfileReaderText::read() {
return sampleprof_error::success;
}
-bool SampleProfileReaderText::hasFormat(const MemoryBuffer &Buffer) {
- bool result = false;
-
- // Check that the first non-comment line is a valid function header.
- line_iterator LineIt(Buffer, /*SkipBlanks=*/true, '#');
- if (!LineIt.is_at_eof()) {
- if ((*LineIt)[0] != ' ') {
- uint64_t NumSamples, NumHeadSamples;
- StringRef FName;
- result = ParseHead(*LineIt, FName, NumSamples, NumHeadSamples);
- }
- }
-
- return result;
-}
-
template <typename T> ErrorOr<T> SampleProfileReaderBinary::readNumber() {
unsigned NumBytesRead = 0;
std::error_code EC;
@@ -701,10 +685,8 @@ SampleProfileReader::create(StringRef Filename, LLVMContext &C) {
Reader.reset(new SampleProfileReaderBinary(std::move(Buffer), C));
else if (SampleProfileReaderGCC::hasFormat(*Buffer))
Reader.reset(new SampleProfileReaderGCC(std::move(Buffer), C));
- else if (SampleProfileReaderText::hasFormat(*Buffer))
- Reader.reset(new SampleProfileReaderText(std::move(Buffer), C));
else
- return sampleprof_error::unrecognized_format;
+ Reader.reset(new SampleProfileReaderText(std::move(Buffer), C));
if (std::error_code EC = Reader->readHeader())
return EC;
OpenPOWER on IntegriCloud