mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:31:15 +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:
@@ -35,7 +35,7 @@ struct NonMovable {
|
||||
|
||||
TEST(IndirectValueTest, Create) {
|
||||
IndirectValue<NonMovable> v =
|
||||
CreateIndirectValue([] { return NonMovable(42); });
|
||||
MakeIndirectValue([] { return NonMovable(42); });
|
||||
EXPECT_EQ(v->i, 42);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ auto GetIntReference() -> const int& {
|
||||
}
|
||||
|
||||
TEST(IndirectValueTest, CreateWithDecay) {
|
||||
auto v = CreateIndirectValue(GetIntReference);
|
||||
auto v = MakeIndirectValue(GetIntReference);
|
||||
EXPECT_TRUE((std::is_same_v<decltype(v), IndirectValue<int>>));
|
||||
EXPECT_EQ(*v, 42);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user