aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/WhitespaceManager.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-05-29 14:47:47 +0000
committerManuel Klimek <klimek@google.com>2013-05-29 14:47:47 +0000
commit6e6310ec843d77ae2eae888cb5e76e09c5aa2720 (patch)
tree5b2264c43d178b6882187f6b7adcb6b4879536b0 /clang/lib/Format/WhitespaceManager.cpp
parent4161813a5004b105931ad845465415610c8e93d7 (diff)
downloadllvm-6e6310ec843d77ae2eae888cb5e76e09c5aa2720.zip
llvm-6e6310ec843d77ae2eae888cb5e76e09c5aa2720.tar.gz
llvm-6e6310ec843d77ae2eae888cb5e76e09c5aa2720.tar.bz2
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). llvm-svn: 182859
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
-rw-r--r--clang/lib/Format/WhitespaceManager.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp
index 069b0c4..e6e4e01 100644
--- a/clang/lib/Format/WhitespaceManager.cpp
+++ b/clang/lib/Format/WhitespaceManager.cpp
@@ -38,14 +38,13 @@ WhitespaceManager::Change::Change(
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,