From 5cc8e8e46cffb91599efc751efa20c6bdf350884 Mon Sep 17 00:00:00 2001
From: Benjamin Kramer <benny.kra@googlemail.com>
Date: Mon, 19 Dec 2016 21:10:50 +0000
Subject: [PATCH] [Format] Remove dead code.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290135 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Format/Encoding.h            | 20 --------------------
 lib/Format/TokenAnalyzer.h       |  3 ---
 lib/Format/WhitespaceManager.cpp |  5 -----
 lib/Format/WhitespaceManager.h   |  3 ---
 4 files changed, 31 deletions(-)

diff --git a/lib/Format/Encoding.h b/lib/Format/Encoding.h
index b2103cb412e..3339597b4ed 100644
--- a/lib/Format/Encoding.h
+++ b/lib/Format/Encoding.h
@@ -40,26 +40,6 @@ inline Encoding detectEncoding(StringRef Text) {
   return Encoding_Unknown;
 }
 
-inline unsigned getCodePointCountUTF8(StringRef Text) {
-  unsigned CodePoints = 0;
-  for (size_t i = 0, e = Text.size(); i < e;
-       i += llvm::getNumBytesForUTF8(Text[i])) {
-    ++CodePoints;
-  }
-  return CodePoints;
-}
-
-/// \brief Gets the number of code points in the Text using the specified
-/// Encoding.
-inline unsigned getCodePointCount(StringRef Text, Encoding Encoding) {
-  switch (Encoding) {
-  case Encoding_UTF8:
-    return getCodePointCountUTF8(Text);
-  default:
-    return Text.size();
-  }
-}
-
 /// \brief Returns the number of columns required to display the \p Text on a
 /// generic Unicode-capable terminal. Text is assumed to use the specified
 /// \p Encoding.
diff --git a/lib/Format/TokenAnalyzer.h b/lib/Format/TokenAnalyzer.h
index b49f3da348a..78a3d1bc8d9 100644
--- a/lib/Format/TokenAnalyzer.h
+++ b/lib/Format/TokenAnalyzer.h
@@ -55,15 +55,12 @@ public:
 
   FileID getFileID() const { return ID; }
 
-  StringRef getFileName() const { return FileName; }
-
   ArrayRef<CharSourceRange> getCharRanges() const { return CharRanges; }
 
   const SourceManager &getSourceManager() const { return SM; }
 
 private:
   FileID ID;
-  StringRef FileName;
   SmallVector<CharSourceRange, 8> CharRanges;
   SourceManager &SM;
 
diff --git a/lib/Format/WhitespaceManager.cpp b/lib/Format/WhitespaceManager.cpp
index ebc72a9d458..6fe477efd76 100644
--- a/lib/Format/WhitespaceManager.cpp
+++ b/lib/Format/WhitespaceManager.cpp
@@ -42,11 +42,6 @@ WhitespaceManager::Change::Change(
       TokenLength(0), PreviousEndOfTokenColumn(0), EscapedNewlineColumn(0),
       StartOfBlockComment(nullptr), IndentationOffset(0) {}
 
-void WhitespaceManager::reset() {
-  Changes.clear();
-  Replaces.clear();
-}
-
 void WhitespaceManager::replaceWhitespace(FormatToken &Tok, unsigned Newlines,
                                           unsigned IndentLevel, unsigned Spaces,
                                           unsigned StartOfTokenColumn,
diff --git a/lib/Format/WhitespaceManager.h b/lib/Format/WhitespaceManager.h
index 3562347a0e6..f42e371830b 100644
--- a/lib/Format/WhitespaceManager.h
+++ b/lib/Format/WhitespaceManager.h
@@ -41,9 +41,6 @@ public:
                     bool UseCRLF)
       : SourceMgr(SourceMgr), Style(Style), UseCRLF(UseCRLF) {}
 
-  /// \brief Prepares the \c WhitespaceManager for another run.
-  void reset();
-
   /// \brief Replaces the whitespace in front of \p Tok. Only call once for
   /// each \c AnnotatedToken.
   void replaceWhitespace(FormatToken &Tok, unsigned Newlines,
-- 
GitLab