mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Rename PointerType::type to pointee_type. (#2468)
This avoids the confusion that can arise from the natural assumption that `foo->type()` returns the type of the value `foo`.
This commit is contained in:
@@ -450,7 +450,7 @@ void Value::Print(llvm::raw_ostream& out) const {
|
||||
out << "Continuation";
|
||||
break;
|
||||
case Value::Kind::PointerType:
|
||||
out << cast<PointerType>(*this).type() << "*";
|
||||
out << cast<PointerType>(*this).pointee_type() << "*";
|
||||
break;
|
||||
case Value::Kind::FunctionType: {
|
||||
const auto& fn_type = cast<FunctionType>(*this);
|
||||
@@ -722,8 +722,8 @@ auto TypeEqual(Nonnull<const Value*> t1, Nonnull<const Value*> t2,
|
||||
}
|
||||
switch (t1->kind()) {
|
||||
case Value::Kind::PointerType:
|
||||
return TypeEqual(&cast<PointerType>(*t1).type(),
|
||||
&cast<PointerType>(*t2).type(), equality_ctx);
|
||||
return TypeEqual(&cast<PointerType>(*t1).pointee_type(),
|
||||
&cast<PointerType>(*t2).pointee_type(), equality_ctx);
|
||||
case Value::Kind::FunctionType: {
|
||||
const auto& fn1 = cast<FunctionType>(*t1);
|
||||
const auto& fn2 = cast<FunctionType>(*t2);
|
||||
|
||||
Reference in New Issue
Block a user