mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 21:58:11 +00:00
Pointers (#1060)
* Naive pointer implementation * Bug fixes and better pointer tests * Remove debug print statement * Implement changes suggested by @geoffromer Also add a failing test case that tests applying the address-of operator to an rvalue.
This commit is contained in:
1 parent
f6cbd2231e
commit
4479c55305
11 files changed
+131
-5
No files matched your search
@@ -179,8 +179,11 @@ void Value::Print(llvm::raw_ostream& out) const {
|
||||
case Value::Kind::FunctionValue:
|
||||
out << "fun<" << cast<FunctionValue>(*this).declaration().name() << ">";
|
||||
break;
|
||||
case Value::Kind::PointerValue:
|
||||
out << "ptr<" << cast<PointerValue>(*this).address() << ">";
|
||||
break;
|
||||
case Value::Kind::LValue:
|
||||
out << "ptr<" << cast<LValue>(*this).address() << ">";
|
||||
out << "lval<" << cast<LValue>(*this).address() << ">";
|
||||
break;
|
||||
case Value::Kind::BoolType:
|
||||
out << "Bool";
|
||||
@@ -434,6 +437,7 @@ auto ValueEqual(Nonnull<const Value*> v1, Nonnull<const Value*> v2) -> bool {
|
||||
case Value::Kind::BindingPlaceholderValue:
|
||||
case Value::Kind::AlternativeConstructorValue:
|
||||
case Value::Kind::ContinuationValue:
|
||||
case Value::Kind::PointerValue:
|
||||
case Value::Kind::LValue:
|
||||
// TODO: support pointer comparisons once we have a clearer distinction
|
||||
// between pointers and lvalues.
|
||||
|
||||
Reference in new issue
Block a user