Changeset 69bafd2 for src/AST/Expr.hpp
- Timestamp:
- May 15, 2019, 3:57:26 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 3648d98
- Parents:
- 9e1d485 (diff), be567e9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
r9e1d485 r69bafd2 27 27 namespace ast { 28 28 29 /// Contains the ID of a declaration and a type that is derived from that declaration, 29 /// Contains the ID of a declaration and a type that is derived from that declaration, 30 30 /// but subject to decay-to-pointer and type parameter renaming 31 31 struct ParamEntry { … … 74 74 case Empty: return; 75 75 case Slots: new(&data.resnSlots) ResnSlots{ std::move(o.data.resnSlots) }; return; 76 case Params: 76 case Params: 77 77 new(&data.inferParams) InferredParams{ std::move(o.data.inferParams) }; return; 78 78 } … … 121 121 Expr * set_extension( bool ex ) { extension = ex; return this; } 122 122 123 virtual Expr * accept( Visitor & v )override = 0;123 virtual const Expr * accept( Visitor & v ) const override = 0; 124 124 private: 125 125 virtual Expr * clone() const override = 0; … … 133 133 TypeExpr( const CodeLocation & loc, const Type * t ) : Expr(loc), type(t) {} 134 134 135 Expr * accept( Visitor & v )override { return v.visit( this ); }135 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } 136 136 private: 137 137 TypeExpr * clone() const override { return new TypeExpr{ *this }; } 138 138 }; 139 139 140 141 //================================================================================================= 142 /// This disgusting and giant piece of boiler-plate is here to solve a cyclic dependency 143 /// remove only if there is a better solution 144 /// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with 145 /// forward declarations 146 inline void increment( const class Expr * node, Node::ref_type ref ) { node->increment(ref); } 147 inline void decrement( const class Expr * node, Node::ref_type ref ) { node->decrement(ref); } 148 // inline void increment( const class ApplicationExpr * node, Node::ref_type ref ) { node->increment(ref); } 149 // inline void decrement( const class ApplicationExpr * node, Node::ref_type ref ) { node->decrement(ref); } 150 // inline void increment( const class UntypedExpr * node, Node::ref_type ref ) { node->increment(ref); } 151 // inline void decrement( const class UntypedExpr * node, Node::ref_type ref ) { node->decrement(ref); } 152 // inline void increment( const class NameExpr * node, Node::ref_type ref ) { node->increment(ref); } 153 // inline void decrement( const class NameExpr * node, Node::ref_type ref ) { node->decrement(ref); } 154 // inline void increment( const class AddressExpr * node, Node::ref_type ref ) { node->increment(ref); } 155 // inline void decrement( const class AddressExpr * node, Node::ref_type ref ) { node->decrement(ref); } 156 // inline void increment( const class LabelAddressExpr * node, Node::ref_type ref ) { node->increment(ref); } 157 // inline void decrement( const class LabelAddressExpr * node, Node::ref_type ref ) { node->decrement(ref); } 158 // inline void increment( const class CastExpr * node, Node::ref_type ref ) { node->increment(ref); } 159 // inline void decrement( const class CastExpr * node, Node::ref_type ref ) { node->decrement(ref); } 160 // inline void increment( const class KeywordCastExpr * node, Node::ref_type ref ) { node->increment(ref); } 161 // inline void decrement( const class KeywordCastExpr * node, Node::ref_type ref ) { node->decrement(ref); } 162 // inline void increment( const class VirtualCastExpr * node, Node::ref_type ref ) { node->increment(ref); } 163 // inline void decrement( const class VirtualCastExpr * node, Node::ref_type ref ) { node->decrement(ref); } 164 // inline void increment( const class MemberExpr * node, Node::ref_type ref ) { node->increment(ref); } 165 // inline void decrement( const class MemberExpr * node, Node::ref_type ref ) { node->decrement(ref); } 166 // inline void increment( const class UntypedMemberExpr * node, Node::ref_type ref ) { node->increment(ref); } 167 // inline void decrement( const class UntypedMemberExpr * node, Node::ref_type ref ) { node->decrement(ref); } 168 // inline void increment( const class VariableExpr * node, Node::ref_type ref ) { node->increment(ref); } 169 // inline void decrement( const class VariableExpr * node, Node::ref_type ref ) { node->decrement(ref); } 170 // inline void increment( const class ConstantExpr * node, Node::ref_type ref ) { node->increment(ref); } 171 // inline void decrement( const class ConstantExpr * node, Node::ref_type ref ) { node->decrement(ref); } 172 // inline void increment( const class SizeofExpr * node, Node::ref_type ref ) { node->increment(ref); } 173 // inline void decrement( const class SizeofExpr * node, Node::ref_type ref ) { node->decrement(ref); } 174 // inline void increment( const class AlignofExpr * node, Node::ref_type ref ) { node->increment(ref); } 175 // inline void decrement( const class AlignofExpr * node, Node::ref_type ref ) { node->decrement(ref); } 176 // inline void increment( const class UntypedOffsetofExpr * node, Node::ref_type ref ) { node->increment(ref); } 177 // inline void decrement( const class UntypedOffsetofExpr * node, Node::ref_type ref ) { node->decrement(ref); } 178 // inline void increment( const class OffsetofExpr * node, Node::ref_type ref ) { node->increment(ref); } 179 // inline void decrement( const class OffsetofExpr * node, Node::ref_type ref ) { node->decrement(ref); } 180 // inline void increment( const class OffsetPackExpr * node, Node::ref_type ref ) { node->increment(ref); } 181 // inline void decrement( const class OffsetPackExpr * node, Node::ref_type ref ) { node->decrement(ref); } 182 // inline void increment( const class AttrExpr * node, Node::ref_type ref ) { node->increment(ref); } 183 // inline void decrement( const class AttrExpr * node, Node::ref_type ref ) { node->decrement(ref); } 184 // inline void increment( const class LogicalExpr * node, Node::ref_type ref ) { node->increment(ref); } 185 // inline void decrement( const class LogicalExpr * node, Node::ref_type ref ) { node->decrement(ref); } 186 // inline void increment( const class ConditionalExpr * node, Node::ref_type ref ) { node->increment(ref); } 187 // inline void decrement( const class ConditionalExpr * node, Node::ref_type ref ) { node->decrement(ref); } 188 // inline void increment( const class CommaExpr * node, Node::ref_type ref ) { node->increment(ref); } 189 // inline void decrement( const class CommaExpr * node, Node::ref_type ref ) { node->decrement(ref); } 190 // inline void increment( const class TypeExpr * node, Node::ref_type ref ) { node->increment(ref); } 191 // inline void decrement( const class TypeExpr * node, Node::ref_type ref ) { node->decrement(ref); } 192 // inline void increment( const class AsmExpr * node, Node::ref_type ref ) { node->increment(ref); } 193 // inline void decrement( const class AsmExpr * node, Node::ref_type ref ) { node->decrement(ref); } 194 // inline void increment( const class ImplicitCopyCtorExpr * node, Node::ref_type ref ) { node->increment(ref); } 195 // inline void decrement( const class ImplicitCopyCtorExpr * node, Node::ref_type ref ) { node->decrement(ref); } 196 // inline void increment( const class ConstructorExpr * node, Node::ref_type ref ) { node->increment(ref); } 197 // inline void decrement( const class ConstructorExpr * node, Node::ref_type ref ) { node->decrement(ref); } 198 // inline void increment( const class CompoundLiteralExpr * node, Node::ref_type ref ) { node->increment(ref); } 199 // inline void decrement( const class CompoundLiteralExpr * node, Node::ref_type ref ) { node->decrement(ref); } 200 // inline void increment( const class UntypedValofExpr * node, Node::ref_type ref ) { node->increment(ref); } 201 // inline void decrement( const class UntypedValofExpr * node, Node::ref_type ref ) { node->decrement(ref); } 202 // inline void increment( const class RangeExpr * node, Node::ref_type ref ) { node->increment(ref); } 203 // inline void decrement( const class RangeExpr * node, Node::ref_type ref ) { node->decrement(ref); } 204 // inline void increment( const class UntypedTupleExpr * node, Node::ref_type ref ) { node->increment(ref); } 205 // inline void decrement( const class UntypedTupleExpr * node, Node::ref_type ref ) { node->decrement(ref); } 206 // inline void increment( const class TupleExpr * node, Node::ref_type ref ) { node->increment(ref); } 207 // inline void decrement( const class TupleExpr * node, Node::ref_type ref ) { node->decrement(ref); } 208 // inline void increment( const class TupleIndexExpr * node, Node::ref_type ref ) { node->increment(ref); } 209 // inline void decrement( const class TupleIndexExpr * node, Node::ref_type ref ) { node->decrement(ref); } 210 // inline void increment( const class TupleAssignExpr * node, Node::ref_type ref ) { node->increment(ref); } 211 // inline void decrement( const class TupleAssignExpr * node, Node::ref_type ref ) { node->decrement(ref); } 212 // inline void increment( const class StmtExpr * node, Node::ref_type ref ) { node->increment(ref); } 213 // inline void decrement( const class StmtExpr * node, Node::ref_type ref ) { node->decrement(ref); } 214 // inline void increment( const class UniqueExpr * node, Node::ref_type ref ) { node->increment(ref); } 215 // inline void decrement( const class UniqueExpr * node, Node::ref_type ref ) { node->decrement(ref); } 216 // inline void increment( const class UntypedInitExpr * node, Node::ref_type ref ) { node->increment(ref); } 217 // inline void decrement( const class UntypedInitExpr * node, Node::ref_type ref ) { node->decrement(ref); } 218 // inline void increment( const class InitExpr * node, Node::ref_type ref ) { node->increment(ref); } 219 // inline void decrement( const class InitExpr * node, Node::ref_type ref ) { node->decrement(ref); } 220 // inline void increment( const class DeletedExpr * node, Node::ref_type ref ) { node->increment(ref); } 221 // inline void decrement( const class DeletedExpr * node, Node::ref_type ref ) { node->decrement(ref); } 222 // inline void increment( const class DefaultArgExpr * node, Node::ref_type ref ) { node->increment(ref); } 223 // inline void decrement( const class DefaultArgExpr * node, Node::ref_type ref ) { node->decrement(ref); } 224 // inline void increment( const class GenericExpr * node, Node::ref_type ref ) { node->increment(ref); } 225 // inline void decrement( const class GenericExpr * node, Node::ref_type ref ) { node->decrement(ref); } 140 226 } 141 227
Note: See TracChangeset
for help on using the changeset viewer.