Remove global_arena (#814)

With this, only main.cpp instantiates an arena. Maybe we'll want to split that up more later (e.g., so that the runtime interpreter uses its own arena), but given the intent to have type-checking update the AST, I thought this was a reasonable approach for now in order to avoid ownership complexities.

Fixes #769
This commit is contained in:
Jon Meow
2021-09-09 11:00:57 -07:00
committed by GitHub
parent 3610325c38
commit 90f04700e2
27 changed files with 568 additions and 581 deletions
+5 -4
View File
@@ -13,6 +13,7 @@
#include "common/ostream.h"
#include "executable_semantics/ast/paren_contents.h"
#include "executable_semantics/ast/source_location.h"
#include "executable_semantics/common/arena.h"
#include "llvm/Support/Compiler.h"
namespace Carbon {
@@ -62,14 +63,14 @@ class Expression {
// grouping if their contents permit that interpretation, or as forming a
// tuple otherwise.
auto ExpressionFromParenContents(
SourceLocation loc, const ParenContents<Expression>& paren_contents)
-> Ptr<const Expression>;
Ptr<Arena> arena, SourceLocation loc,
const ParenContents<Expression>& paren_contents) -> Ptr<const Expression>;
// Converts paren_contents to an Expression, interpreting the parentheses as
// forming a tuple.
auto TupleExpressionFromParenContents(
SourceLocation loc, const ParenContents<Expression>& paren_contents)
-> Ptr<const Expression>;
Ptr<Arena> arena, SourceLocation loc,
const ParenContents<Expression>& paren_contents) -> Ptr<const Expression>;
// A FieldInitializer represents the initialization of a single tuple field.
struct FieldInitializer {