The second step in the token refactoring.
Gets rid of AnnotatedToken, putting everything into FormatToken.
FormatTokens are created once, and only referenced by pointer. This
enables multiple future features, like having tokens shared between
multiple UnwrappedLines (while there's still work to do to fully enable
that).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182859 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Format/WhitespaceManager.cpp b/lib/Format/WhitespaceManager.cpp
index 069b0c4..e6e4e01 100644
--- a/lib/Format/WhitespaceManager.cpp
+++ b/lib/Format/WhitespaceManager.cpp
@@ -38,14 +38,13 @@
CurrentLinePrefix(CurrentLinePrefix), Kind(Kind),
ContinuesPPDirective(ContinuesPPDirective), Spaces(Spaces) {}
-void WhitespaceManager::replaceWhitespace(const AnnotatedToken &Tok,
+void WhitespaceManager::replaceWhitespace(const FormatToken &Tok,
unsigned Newlines, unsigned Spaces,
unsigned StartOfTokenColumn,
bool InPPDirective) {
Changes.push_back(
- Change(true, Tok.FormatTok->WhitespaceRange, Spaces, StartOfTokenColumn,
- Newlines, "", "", Tok.FormatTok->Tok.getKind(),
- InPPDirective && !Tok.FormatTok->IsFirst));
+ Change(true, Tok.WhitespaceRange, Spaces, StartOfTokenColumn, Newlines,
+ "", "", Tok.Tok.getKind(), InPPDirective && !Tok.IsFirst));
}
void WhitespaceManager::addUntouchableToken(const FormatToken &Tok,