From 396d8018b22699ae2eb2d22de9f49082527edd5f Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Tue, 13 Oct 2015 22:48:48 +0000 Subject: [PATCH] Sample profile reader - remove dead code. NFC. This removes old remnants from the gcov reader. I missed these when I re-wrote it recently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250242 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ProfileData/SampleProfReader.h | 25 --------------------- lib/ProfileData/SampleProfReader.cpp | 10 --------- 2 files changed, 35 deletions(-) diff --git a/include/llvm/ProfileData/SampleProfReader.h b/include/llvm/ProfileData/SampleProfReader.h index 75031e496fd..ade808b9e46 100644 --- a/include/llvm/ProfileData/SampleProfReader.h +++ b/include/llvm/ProfileData/SampleProfReader.h @@ -173,31 +173,6 @@ protected: std::vector NameTable; }; -// Represents the source position in GCC sample profiles. -struct SourceInfo { - SourceInfo() - : FuncName(), DirName(), FileName(), StartLine(0), Line(0), - Discriminator(0) {} - - SourceInfo(StringRef FuncName, StringRef DirName, StringRef FileName, - uint32_t StartLine, uint32_t Line, uint32_t Discriminator) - : FuncName(FuncName), DirName(DirName), FileName(FileName), - StartLine(StartLine), Line(Line), Discriminator(Discriminator) {} - - bool operator<(const SourceInfo &p) const; - - uint32_t Offset() const { return ((Line - StartLine) << 16) | Discriminator; } - - bool Malformed() const { return Line < StartLine; } - - StringRef FuncName; - StringRef DirName; - StringRef FileName; - uint32_t StartLine; - uint32_t Line; - uint32_t Discriminator; -}; - typedef SmallVector InlineCallStack; // Supported histogram types in GCC. Currently, we only need support for diff --git a/lib/ProfileData/SampleProfReader.cpp b/lib/ProfileData/SampleProfReader.cpp index a058274e8ee..b0a3d4ef262 100644 --- a/lib/ProfileData/SampleProfReader.cpp +++ b/lib/ProfileData/SampleProfReader.cpp @@ -521,16 +521,6 @@ bool SampleProfileReaderBinary::hasFormat(const MemoryBuffer &Buffer) { return Magic == SPMagic(); } -bool SourceInfo::operator<(const SourceInfo &P) const { - if (Line != P.Line) - return Line < P.Line; - if (StartLine != P.StartLine) - return StartLine < P.StartLine; - if (Discriminator != P.Discriminator) - return Discriminator < P.Discriminator; - return FuncName < P.FuncName; -} - std::error_code SampleProfileReaderGCC::skipNextWord() { uint32_t dummy; if (!GcovBuffer.readInt(dummy)) -- 2.34.1