mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Rename factory functions from 'Create' to 'Make' (#3706)
Similar to #3705, we actually have a mix of `Make` and `Create` in factory functions too, so this PR is normalizing on `Make`. It's intended to be consistent with the naming choice for Carbon factory functions. Note, MakeSyntheticBlock is the only one I feel a little weird about because llvm's own APIs use Create, and this is essentially wrapping LLVM calls. But the flipside is it also feels like a vague line to draw, when we also differ from LLVM coding style in other ways.
This commit is contained in:
@@ -36,14 +36,13 @@ class SourceBuffer {
|
||||
public:
|
||||
// Opens and reads the contents of stdin. Returns a SourceBuffer on success.
|
||||
// Prints an error and returns nullopt on failure.
|
||||
static auto CreateFromStdin(DiagnosticConsumer& consumer)
|
||||
static auto MakeFromStdin(DiagnosticConsumer& consumer)
|
||||
-> std::optional<SourceBuffer>;
|
||||
|
||||
// Opens the requested file. Returns a SourceBuffer on success. Prints an
|
||||
// error and returns nullopt on failure.
|
||||
static auto CreateFromFile(llvm::vfs::FileSystem& fs,
|
||||
llvm::StringRef filename,
|
||||
DiagnosticConsumer& consumer)
|
||||
static auto MakeFromFile(llvm::vfs::FileSystem& fs, llvm::StringRef filename,
|
||||
DiagnosticConsumer& consumer)
|
||||
-> std::optional<SourceBuffer>;
|
||||
|
||||
// Use one of the factory functions above to create a source buffer.
|
||||
@@ -60,7 +59,7 @@ class SourceBuffer {
|
||||
private:
|
||||
// Creates a `SourceBuffer` from the given `llvm::MemoryBuffer`. Prints an
|
||||
// error and returns nullopt on failure.
|
||||
static auto CreateFromMemoryBuffer(
|
||||
static auto MakeFromMemoryBuffer(
|
||||
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> buffer,
|
||||
llvm::StringRef filename, bool is_regular_file,
|
||||
DiagnosticConsumer& consumer) -> std::optional<SourceBuffer>;
|
||||
|
||||
Reference in New Issue
Block a user