[PATCH] D28010: FileOutputBuffer: support non-mmap'able file.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 21 01:13:52 PST 2016
grimar added inline comments.
================
Comment at: llvm/lib/Support/FileOutputBuffer.cpp:159
+ if (fs::is_other(Stat))
+ return std::unique_ptr<FileOutputBuffer>(
+ new FileOutputBuffer(Path, Size, new NonMMappedFile(Path, Size)));
----------------
ruiu wrote:
> grimar wrote:
> > llvm::make_unique may be ?
> Why?
That should be shorter and avoids using "new".
It is generally also consistent with recomendations to use std::make_shared instead of std::shared_ptr(new X) which is preffered because of different reasons usually (single allocation of T and control block in most of implementations for example).
https://reviews.llvm.org/D28010
More information about the llvm-commits
mailing list