]> granicus.if.org Git - clang/commitdiff
[Format] Remove dead code.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 19 Dec 2016 21:10:50 +0000 (21:10 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 19 Dec 2016 21:10:50 +0000 (21:10 +0000)
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290135 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/Encoding.h
lib/Format/TokenAnalyzer.h
lib/Format/WhitespaceManager.cpp
lib/Format/WhitespaceManager.h

index b2103cb412eed8117382e7eb3802302b1029b327..3339597b4edd7a49e8cb9d95c9345bce1b4e0fec 100644 (file)
@@ -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.
index b49f3da348a16d03ba43a50d37b86aada7bdab72..78a3d1bc8d9e5c030242d94c722f4b8d56e39ac8 100644 (file)
@@ -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;
 
index ebc72a9d458117a1d353d0e1c768ee759c3ea06d..6fe477efd76ba2e6dd6dfe59e891c9aec92c210a 100644 (file)
@@ -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,
index 3562347a0e60a8a5281ed923f1f57ac3750f3b81..f42e371830b3d2d4a58075a0487ecbbf6f7dc780 100644 (file)
@@ -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,