mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 10:21:04 +01:00
Move Value, Address, and ElementPath to ast/. (#2659)
These are used by the AST in lots of ways, and this resolves various layering issues. This means that `AllocationId` also lives in ast/, but is managed by interpreter/. A better layering here would be desirable, but this seems good enough for the time being.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <optional>
|
||||
|
||||
#include "explorer/ast/pattern.h"
|
||||
#include "explorer/ast/value.h"
|
||||
#include "explorer/common/arena.h"
|
||||
#include "explorer/common/error_builders.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
@@ -340,9 +341,11 @@ void Expression::PrintID(llvm::raw_ostream& out) const {
|
||||
case ExpressionKind::ContinuationTypeLiteral:
|
||||
out << "Continuation";
|
||||
break;
|
||||
case ExpressionKind::FunctionTypeLiteral:
|
||||
case ExpressionKind::StructLiteral:
|
||||
case ExpressionKind::ArrayTypeLiteral:
|
||||
case ExpressionKind::ValueLiteral:
|
||||
// TODO: For layering reasons, we can't print out the value from here.
|
||||
out << "ValueLiteral";
|
||||
out << cast<ConstantValueLiteral>(*this).constant_value();
|
||||
break;
|
||||
case ExpressionKind::IndexExpression:
|
||||
case ExpressionKind::SimpleMemberAccessExpression:
|
||||
@@ -352,14 +355,11 @@ void Expression::PrintID(llvm::raw_ostream& out) const {
|
||||
case ExpressionKind::WhereExpression:
|
||||
case ExpressionKind::BuiltinConvertExpression:
|
||||
case ExpressionKind::TupleLiteral:
|
||||
case ExpressionKind::StructLiteral:
|
||||
case ExpressionKind::StructTypeLiteral:
|
||||
case ExpressionKind::CallExpression:
|
||||
case ExpressionKind::OperatorExpression:
|
||||
case ExpressionKind::IntrinsicExpression:
|
||||
case ExpressionKind::UnimplementedExpression:
|
||||
case ExpressionKind::FunctionTypeLiteral:
|
||||
case ExpressionKind::ArrayTypeLiteral:
|
||||
out << "...";
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user