[PATCH] D120404: [NFC][Lexer] Remove getLangOpts function from Lexer

Dawid Jurczak via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 23 05:31:58 PST 2022


yurai007 added inline comments.


================
Comment at: clang/lib/Lex/ModuleMap.cpp:1617
     const char *Start = SpellingBuffer.data();
-    unsigned Length =
-        Lexer::getSpelling(LToken, Start, SourceMgr, L.getLangOpts());
+    unsigned Length = L.getSpelling(LToken, Start, SourceMgr);
     uint64_t Value;
----------------
That's interesting. ModuleMapParser::Map already has LangOpts member (which is const LangOptions &). If we could prove there are equal to Lexer::LangOpts after: https://reviews.llvm.org/D120334 maybe it would be possible to not introduce Lexer::getSpelling convenience method at all.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120404



More information about the cfe-commits mailing list