@@ -64,7 +64,7 @@ namespace herschel
64
64
65
65
class Scope ;
66
66
67
- using NodeList = std::vector<Ptr <AptNode>>;
67
+ using NodeList = std::vector<std::shared_ptr <AptNode>>;
68
68
69
69
// ------------------------------------------------------------------------------
70
70
@@ -83,56 +83,56 @@ namespace herschel
83
83
84
84
Annotator (std::shared_ptr<Scope> scope, Compiler& compiler);
85
85
86
- void annotateRecursively (AptNode* node);
87
-
88
- void annotateNode (AptNode* node);
89
-
90
- void annotate (CompileUnitNode* node);
91
-
92
- void annotate (SymbolNode* node);
93
-
94
- void annotate (DefNode* node);
95
- void annotate (LetNode* node);
96
- void annotate (BlockNode* node);
97
-
98
- void annotate (ParamNode* node);
99
-
100
- void annotate (ApplyNode* node);
101
- void annotate (ArrayNode* node);
102
- void annotate (ArrayTypeNode* node);
103
- void annotate (AssignNode* node);
104
- void annotate (BinaryNode* node);
105
- void annotate (BoolNode* node);
106
- void annotate (CastNode* node);
107
- void annotate (CharNode* node);
108
- void annotate (DictNode* node);
109
- void annotate (FunctionNode* node);
110
- void annotate (IfNode* node);
111
- void annotate (IntNode* node);
112
- void annotate (KeyargNode* node);
113
- void annotate (KeywordNode* node);
114
- void annotate (MatchNode* node);
115
- void annotate (UnaryNode* node);
116
- void annotate (OnNode* node);
117
- void annotate (RangeNode* node);
118
- void annotate (RationalNode* node);
119
- void annotate (RealNode* node);
120
- void annotate (SelectNode* node);
121
- void annotate (SlotdefNode* node);
122
- void annotate (SlotRefNode* node);
123
- void annotate (StringNode* node);
124
- void annotate (TypeDefNode* node);
125
- void annotate (TypeNode* node);
126
- void annotate (UnitConstNode* node);
127
- void annotate (VectorNode* node);
128
- void annotate (WhileNode* node);
129
- void annotate (UndefNode* node);
86
+ void annotateRecursively (std::shared_ptr< AptNode> node);
87
+
88
+ void annotateNode (std::shared_ptr< AptNode> node);
89
+
90
+ void annotate (std::shared_ptr< CompileUnitNode> node);
91
+
92
+ void annotate (std::shared_ptr< SymbolNode> node);
93
+
94
+ void annotate (std::shared_ptr< DefNode> node);
95
+ void annotate (std::shared_ptr< LetNode> node);
96
+ void annotate (std::shared_ptr< BlockNode> node);
97
+
98
+ void annotate (std::shared_ptr< ParamNode> node);
99
+
100
+ void annotate (std::shared_ptr< ApplyNode> node);
101
+ void annotate (std::shared_ptr< ArrayNode> node);
102
+ void annotate (std::shared_ptr< ArrayTypeNode> node);
103
+ void annotate (std::shared_ptr< AssignNode> node);
104
+ void annotate (std::shared_ptr< BinaryNode> node);
105
+ void annotate (std::shared_ptr< BoolNode> node);
106
+ void annotate (std::shared_ptr< CastNode> node);
107
+ void annotate (std::shared_ptr< CharNode> node);
108
+ void annotate (std::shared_ptr< DictNode> node);
109
+ void annotate (std::shared_ptr< FunctionNode> node);
110
+ void annotate (std::shared_ptr< IfNode> node);
111
+ void annotate (std::shared_ptr< IntNode> node);
112
+ void annotate (std::shared_ptr< KeyargNode> node);
113
+ void annotate (std::shared_ptr< KeywordNode> node);
114
+ void annotate (std::shared_ptr< MatchNode> node);
115
+ void annotate (std::shared_ptr< UnaryNode> node);
116
+ void annotate (std::shared_ptr< OnNode> node);
117
+ void annotate (std::shared_ptr< RangeNode> node);
118
+ void annotate (std::shared_ptr< RationalNode> node);
119
+ void annotate (std::shared_ptr< RealNode> node);
120
+ void annotate (std::shared_ptr< SelectNode> node);
121
+ void annotate (std::shared_ptr< SlotdefNode> node);
122
+ void annotate (std::shared_ptr< SlotRefNode> node);
123
+ void annotate (std::shared_ptr< StringNode> node);
124
+ void annotate (std::shared_ptr< TypeDefNode> node);
125
+ void annotate (std::shared_ptr< TypeNode> node);
126
+ void annotate (std::shared_ptr< UnitConstNode> node);
127
+ void annotate (std::shared_ptr< VectorNode> node);
128
+ void annotate (std::shared_ptr< WhileNode> node);
129
+ void annotate (std::shared_ptr< UndefNode> node);
130
130
131
131
private:
132
132
void annotateNodeList (NodeList& nl, bool marktailpos, bool marksingletype);
133
133
134
- void annotate (VardefNode* node, bool isLocal);
135
- void annotate (FuncDefNode* node, bool isLocal);
134
+ void annotate (std::shared_ptr< VardefNode> node, bool isLocal);
135
+ void annotate (std::shared_ptr< FuncDefNode> node, bool isLocal);
136
136
137
137
void takeFullNameFromNode (SymbolNode* node, const AptNode* otherNode);
138
138
bool updateAllocType (SymbolNode* usingNode, const AptNode* referedNode);
@@ -155,7 +155,7 @@ namespace herschel
155
155
{
156
156
public:
157
157
AnnotatePass (int level, std::shared_ptr<Scope> scope, Compiler& compiler);
158
- virtual AptNode* doApply (AptNode* src);
158
+ virtual std::shared_ptr< AptNode> doApply (std::shared_ptr< AptNode> src);
159
159
160
160
private:
161
161
std::shared_ptr<Scope> fScope ;
0 commit comments