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:
David Blaikie
2014-08-11 22:08:06 +00:00
parent c64c175173
commit 3d95d858f9
4 changed files with 17 additions and 17 deletions

View File

@@ -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;
}