[PATCH] D143142: [clang][lex] Enable Lexer to grow its buffer

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 6 18:40:47 PST 2023


shafik added inline comments.


================
Comment at: clang/lib/Lex/Lexer.cpp:1203
     if (L && !L->isLexingRawMode())
-      L->Diag(CP-2, diag::trigraph_ignored);
+      L->Diag(CP - 2 - L->getBuffer().data(), diag::trigraph_ignored);
     return 0;
----------------
I wonder do we really need to do these pointer gymnastics, maybe making this a member function would eliminate the need for it.


================
Comment at: clang/lib/Lex/Lexer.cpp:1815
         PP->getDiagnostics(), LangOpts, C,
-        makeCharRange(*this, BufferPtr, CurPtr), /*IsStart*/ true);
-    BufferPtr = CurPtr;
+        makeCharRange(*this, BufferOffset, CurOffset), /*IsStart*/ true);
+    BufferOffset = CurOffset;
----------------
nit


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143142/new/

https://reviews.llvm.org/D143142



More information about the cfe-commits mailing list