[PATCH] A first step towards giving format tokens pointer identity.

Daniel Jasper djasper at google.com
Tue May 28 04:19:44 PDT 2013



================
Comment at: lib/Format/UnwrappedLineParser.cpp:96
@@ +95,3 @@
+
+  FormatToken *createEOF() {
+    static bool EOFInitialized = false;
----------------
Not sure whether this creates something. How about getEOF() or getFakeEOF()?

================
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; }
+
----------------
nit (for consistency): no != NULL


http://llvm-reviews.chandlerc.com/D875

BRANCH
  token-identity

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list