[PATCH] D89398: Lexer: Update the Lexer to use MemoryBufferRef, NFC

Jonas Devlieghere via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 19 15:16:06 PDT 2020


JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/include/clang/Lex/Lexer.h:145
   /// outlive it, so it doesn't take ownership of either of them.
-  Lexer(FileID FID, const llvm::MemoryBuffer *InputFile, Preprocessor &PP);
+  Lexer(FileID FID, const llvm::MemoryBufferRef &InputFile, Preprocessor &PP);
 
----------------
dexonsmith wrote:
> dexonsmith wrote:
> > JDevlieghere wrote:
> > > Should `MemoryBufferRef`s be passed by value like `StringRef`s?
> > I don't think it absolutely needs to be, but it could, it's just two `StringRef`s. Passing by reference here prevents adding an include unnecessarily.
> That said, I don't feel strongly, happy to change to by-value if you think that's better.
Thanks! I was mostly asking from a "policy" perspective, but avoiding an include seems as good of a motivation as any.


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

https://reviews.llvm.org/D89398



More information about the cfe-commits mailing list