Change MemoryBuffer* to MemoryBuffer& parameter to Lexer::ComputePreamble
(dropping const from the reference as MemoryBuffer is immutable already, so const is just redundant - and while I'd personally put const everywhere, that's not the LLVM Way (see llvm::Type for another example of an immutable type where "const" is omitted for brevity)) Changing the pointer argument to a reference parameter makes call sites identical between callers with unique_ptrs or raw pointers, minimizing the churn in a pending unique_ptr migrations. llvm-svn: 215391
This commit is contained in:
@@ -685,7 +685,7 @@ void PrintPreambleAction::ExecuteAction() {
|
||||
llvm::MemoryBuffer *Buffer
|
||||
= CI.getFileManager().getBufferForFile(getCurrentFile());
|
||||
if (Buffer) {
|
||||
unsigned Preamble = Lexer::ComputePreamble(Buffer, CI.getLangOpts()).first;
|
||||
unsigned Preamble = Lexer::ComputePreamble(*Buffer, CI.getLangOpts()).first;
|
||||
llvm::outs().write(Buffer->getBufferStart(), Preamble);
|
||||
delete Buffer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user