[PATCH] A first step towards giving format tokens pointer identity.
Manuel Klimek
klimek at google.com
Tue May 28 04:22:15 PDT 2013
================
Comment at: lib/Format/UnwrappedLineParser.cpp:94
@@ -84,8 +93,3 @@
private:
- bool eof() { return Token.HasUnescapedNewline; }
-
- FormatToken createEOF() {
- FormatToken FormatTok;
- FormatTok.Tok.startToken();
- FormatTok.Tok.setKind(tok::eof);
- return FormatTok;
+ bool eof() { return Token != NULL && Token->HasUnescapedNewline; }
+
----------------
Daniel Jasper wrote:
> nit (for consistency): no != NULL
Done.
================
Comment at: lib/Format/UnwrappedLineParser.cpp:96
@@ +95,3 @@
+
+ FormatToken *createEOF() {
+ static bool EOFInitialized = false;
----------------
Daniel Jasper wrote:
> Not sure whether this creates something. How about getEOF() or getFakeEOF()?
I like getFakeEOF().
http://llvm-reviews.chandlerc.com/D875
BRANCH
token-identity
ARCANIST PROJECT
clang
More information about the cfe-commits
mailing list