Update Lexer / Lexer::Lexer to use MemoryBufferRef instead of
MemoryBuffer*. Callers that were acquiring a MemoryBuffer* via
SourceManager::getBuffer were updated, such that if they checked
Invalid they use getBufferOrNone and otherwise getBufferOrFake.
Details
Diff Detail
Event Timeline
clang/include/clang/Lex/Lexer.h | ||
---|---|---|
145 | Should MemoryBufferRefs be passed by value like StringRefs? |
clang/include/clang/Lex/Lexer.h | ||
---|---|---|
145 | I don't think it absolutely needs to be, but it could, it's just two StringRefs. Passing by reference here prevents adding an include unnecessarily. |
clang/include/clang/Lex/Lexer.h | ||
---|---|---|
145 | That said, I don't feel strongly, happy to change to by-value if you think that's better. |
LGTM
clang/include/clang/Lex/Lexer.h | ||
---|---|---|
145 | Thanks! I was mostly asking from a "policy" perspective, but avoiding an include seems as good of a motivation as any. |
Should MemoryBufferRefs be passed by value like StringRefs?