Switch allocation of FunctionDefinition to use Ptr (#785)

This commit is contained in:
Jon Meow
2021-08-26 09:33:29 -07:00
committed by GitHub
parent 8b8715e871
commit 5b18f24db0
4 changed files with 11 additions and 10 deletions
+3 -2
View File
@@ -13,6 +13,7 @@
#include "executable_semantics/ast/function_definition.h"
#include "executable_semantics/ast/member.h"
#include "executable_semantics/ast/pattern.h"
#include "executable_semantics/common/ptr.h"
#include "llvm/Support/Compiler.h"
namespace Carbon {
@@ -58,7 +59,7 @@ class Declaration {
class FunctionDeclaration : public Declaration {
public:
FunctionDeclaration(const FunctionDefinition* definition)
FunctionDeclaration(Ptr<const FunctionDefinition> definition)
: Declaration(Kind::FunctionDeclaration, definition->line_num),
definition(definition) {}
@@ -69,7 +70,7 @@ class FunctionDeclaration : public Declaration {
auto Definition() const -> const FunctionDefinition& { return *definition; }
private:
const FunctionDefinition* definition;
Ptr<const FunctionDefinition> definition;
};
class ClassDeclaration : public Declaration {