mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:11:12 +01:00
Rename Ptr<T> to Nonnull<T*> (#832)
Note that ptr.h also includes an enable_if change, to help avoid https://bugs.llvm.org/show_bug.cgi?id=51881
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
auto Heap::AllocateValue(Ptr<const Value> v) -> Address {
|
||||
auto Heap::AllocateValue(Nonnull<const Value*> v) -> Address {
|
||||
// Putting the following two side effects together in this function
|
||||
// ensures that we don't do anything else in between, which is really bad!
|
||||
// Consider whether to include a copy of the input v in this function
|
||||
@@ -20,12 +20,13 @@ auto Heap::AllocateValue(Ptr<const Value> v) -> Address {
|
||||
return a;
|
||||
}
|
||||
|
||||
auto Heap::Read(const Address& a, SourceLocation loc) -> Ptr<const Value> {
|
||||
auto Heap::Read(const Address& a, SourceLocation loc) -> Nonnull<const Value*> {
|
||||
this->CheckAlive(a, loc);
|
||||
return values[a.index]->GetField(arena, a.field_path, loc);
|
||||
}
|
||||
|
||||
void Heap::Write(const Address& a, Ptr<const Value> v, SourceLocation loc) {
|
||||
void Heap::Write(const Address& a, Nonnull<const Value*> v,
|
||||
SourceLocation loc) {
|
||||
this->CheckAlive(a, loc);
|
||||
values[a.index] = values[a.index]->SetField(arena, a.field_path, v, loc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user