[79f7875] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
| 6 | // |
---|
| 7 | // Expr.hpp -- |
---|
| 8 | // |
---|
| 9 | // Author : Aaron B. Moss |
---|
| 10 | // Created On : Fri May 10 10:30:00 2019 |
---|
| 11 | // Last Modified By : Aaron B. Moss |
---|
| 12 | // Created On : Fri May 10 10:30:00 2019 |
---|
| 13 | // Update Count : 1 |
---|
| 14 | // |
---|
| 15 | |
---|
| 16 | #pragma once |
---|
| 17 | |
---|
| 18 | #include <cassert> |
---|
[60aaa51d] | 19 | #include <deque> |
---|
[79f7875] | 20 | #include <map> |
---|
[54e41b3] | 21 | #include <string> |
---|
[79f7875] | 22 | #include <utility> // for move |
---|
| 23 | #include <vector> |
---|
[c36298d] | 24 | #include <optional> |
---|
[79f7875] | 25 | |
---|
| 26 | #include "Fwd.hpp" // for UniqueId |
---|
[54e41b3] | 27 | #include "Label.hpp" |
---|
[79f7875] | 28 | #include "ParseNode.hpp" |
---|
[264e691] | 29 | #include "Visitor.hpp" |
---|
[79f7875] | 30 | |
---|
[f3cc5b6] | 31 | // Must be included in *all* AST classes; should be #undef'd at the end of the file |
---|
[99da267] | 32 | #define MUTATE_FRIEND \ |
---|
| 33 | template<typename node_t> friend node_t * mutate(const node_t * node); \ |
---|
| 34 | template<typename node_t> friend node_t * shallowCopy(const node_t * node); |
---|
| 35 | |
---|
[f3cc5b6] | 36 | |
---|
[20de6fb] | 37 | class ConverterOldToNew; |
---|
[c36298d] | 38 | class ConverterNewToOld; |
---|
[20de6fb] | 39 | |
---|
[79f7875] | 40 | namespace ast { |
---|
| 41 | |
---|
[6d51bd7] | 42 | /// Contains the ID of a declaration and a type that is derived from that declaration, |
---|
[79f7875] | 43 | /// but subject to decay-to-pointer and type parameter renaming |
---|
| 44 | struct ParamEntry { |
---|
| 45 | UniqueId decl; |
---|
[aaeacf4] | 46 | ptr<Decl> declptr; |
---|
[79f7875] | 47 | ptr<Type> actualType; |
---|
| 48 | ptr<Type> formalType; |
---|
| 49 | ptr<Expr> expr; |
---|
| 50 | |
---|
[aaeacf4] | 51 | ParamEntry() : decl( 0 ), declptr( nullptr ), actualType( nullptr ), formalType( nullptr ), expr( nullptr ) {} |
---|
[7870799] | 52 | ParamEntry( |
---|
| 53 | UniqueId id, const Decl * declptr, const Type * actual, const Type * formal, |
---|
[b69233a] | 54 | const Expr * e ) |
---|
[aaeacf4] | 55 | : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {} |
---|
[79f7875] | 56 | }; |
---|
| 57 | |
---|
| 58 | /// Pre-resolution list of parameters to infer |
---|
| 59 | using ResnSlots = std::vector<UniqueId>; |
---|
| 60 | /// Post-resolution map of inferred parameters |
---|
| 61 | using InferredParams = std::map< UniqueId, ParamEntry >; |
---|
| 62 | |
---|
| 63 | /// Base node for expressions |
---|
| 64 | class Expr : public ParseNode { |
---|
| 65 | public: |
---|
| 66 | /// Saves space (~16 bytes) by combining ResnSlots and InferredParams |
---|
| 67 | struct InferUnion { |
---|
| 68 | enum { Empty, Slots, Params } mode; |
---|
| 69 | union data_t { |
---|
| 70 | char def; |
---|
| 71 | ResnSlots resnSlots; |
---|
| 72 | InferredParams inferParams; |
---|
| 73 | |
---|
| 74 | data_t() : def('\0') {} |
---|
| 75 | ~data_t() {} |
---|
| 76 | } data; |
---|
| 77 | |
---|
| 78 | /// initializes from other InferUnion |
---|
| 79 | void init_from( const InferUnion& o ) { |
---|
| 80 | switch ( o.mode ) { |
---|
| 81 | case Empty: return; |
---|
| 82 | case Slots: new(&data.resnSlots) ResnSlots{ o.data.resnSlots }; return; |
---|
| 83 | case Params: new(&data.inferParams) InferredParams{ o.data.inferParams }; return; |
---|
| 84 | } |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | /// initializes from other InferUnion (move semantics) |
---|
| 88 | void init_from( InferUnion&& o ) { |
---|
| 89 | switch ( o.mode ) { |
---|
| 90 | case Empty: return; |
---|
| 91 | case Slots: new(&data.resnSlots) ResnSlots{ std::move(o.data.resnSlots) }; return; |
---|
[6d51bd7] | 92 | case Params: |
---|
[79f7875] | 93 | new(&data.inferParams) InferredParams{ std::move(o.data.inferParams) }; return; |
---|
| 94 | } |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | /// clears variant fields |
---|
| 98 | void reset() { |
---|
| 99 | switch( mode ) { |
---|
| 100 | case Empty: return; |
---|
| 101 | case Slots: data.resnSlots.~ResnSlots(); return; |
---|
| 102 | case Params: data.inferParams.~InferredParams(); return; |
---|
| 103 | } |
---|
| 104 | } |
---|
| 105 | |
---|
| 106 | InferUnion() : mode(Empty), data() {} |
---|
| 107 | InferUnion( const InferUnion& o ) : mode( o.mode ), data() { init_from( o ); } |
---|
| 108 | InferUnion( InferUnion&& o ) : mode( o.mode ), data() { init_from( std::move(o) ); } |
---|
| 109 | InferUnion& operator= ( const InferUnion& ) = delete; |
---|
| 110 | InferUnion& operator= ( InferUnion&& ) = delete; |
---|
| 111 | ~InferUnion() { reset(); } |
---|
| 112 | |
---|
| 113 | ResnSlots& resnSlots() { |
---|
| 114 | switch (mode) { |
---|
| 115 | case Empty: new(&data.resnSlots) ResnSlots{}; mode = Slots; // fallthrough |
---|
| 116 | case Slots: return data.resnSlots; |
---|
[7870799] | 117 | case Params: assertf(false, "Cannot return to resnSlots from Params"); abort(); |
---|
[79f7875] | 118 | } |
---|
[6f096d2] | 119 | assertf(false, "unreachable"); |
---|
[19e567dd] | 120 | } |
---|
| 121 | |
---|
[60aaa51d] | 122 | const ResnSlots& resnSlots() const { |
---|
[19e567dd] | 123 | if (mode == Slots) { |
---|
| 124 | return data.resnSlots; |
---|
| 125 | } |
---|
[7870799] | 126 | assertf(false, "Mode was not already resnSlots"); |
---|
| 127 | abort(); |
---|
[79f7875] | 128 | } |
---|
| 129 | |
---|
| 130 | InferredParams& inferParams() { |
---|
| 131 | switch (mode) { |
---|
| 132 | case Slots: data.resnSlots.~ResnSlots(); // fallthrough |
---|
| 133 | case Empty: new(&data.inferParams) InferredParams{}; mode = Params; // fallthrough |
---|
| 134 | case Params: return data.inferParams; |
---|
| 135 | } |
---|
[7870799] | 136 | assertf(false, "unreachable"); |
---|
[19e567dd] | 137 | } |
---|
| 138 | |
---|
[60aaa51d] | 139 | const InferredParams& inferParams() const { |
---|
[19e567dd] | 140 | if (mode == Params) { |
---|
| 141 | return data.inferParams; |
---|
| 142 | } |
---|
[7870799] | 143 | assertf(false, "Mode was not already Params"); |
---|
| 144 | abort(); |
---|
[79f7875] | 145 | } |
---|
[60aaa51d] | 146 | |
---|
[b69233a] | 147 | void set_inferParams( InferredParams && ps ) { |
---|
| 148 | switch(mode) { |
---|
[7870799] | 149 | case Slots: |
---|
[b69233a] | 150 | data.resnSlots.~ResnSlots(); |
---|
| 151 | // fallthrough |
---|
[7870799] | 152 | case Empty: |
---|
[b69233a] | 153 | new(&data.inferParams) InferredParams{ std::move( ps ) }; |
---|
| 154 | mode = Params; |
---|
| 155 | break; |
---|
| 156 | case Params: |
---|
| 157 | data.inferParams = std::move( ps ); |
---|
| 158 | break; |
---|
| 159 | } |
---|
| 160 | } |
---|
| 161 | |
---|
[aaeacf4] | 162 | /// splices other InferUnion into this one. Will fail if one union is in `Slots` mode |
---|
[60aaa51d] | 163 | /// and the other is in `Params`. |
---|
| 164 | void splice( InferUnion && o ) { |
---|
| 165 | if ( o.mode == Empty ) return; |
---|
| 166 | if ( mode == Empty ) { init_from( o ); return; } |
---|
| 167 | assert( mode == o.mode && "attempt to splice incompatible InferUnion" ); |
---|
| 168 | |
---|
| 169 | if ( mode == Slots ){ |
---|
[aaeacf4] | 170 | data.resnSlots.insert( |
---|
[60aaa51d] | 171 | data.resnSlots.end(), o.data.resnSlots.begin(), o.data.resnSlots.end() ); |
---|
| 172 | } else if ( mode == Params ) { |
---|
| 173 | for ( const auto & p : o.data.inferParams ) { |
---|
| 174 | data.inferParams[p.first] = std::move(p.second); |
---|
| 175 | } |
---|
[7870799] | 176 | } else assertf(false, "invalid mode"); |
---|
[60aaa51d] | 177 | } |
---|
[79f7875] | 178 | }; |
---|
| 179 | |
---|
| 180 | ptr<Type> result; |
---|
| 181 | ptr<TypeSubstitution> env; |
---|
| 182 | InferUnion inferred; |
---|
| 183 | bool extension = false; |
---|
| 184 | |
---|
[54e41b3] | 185 | Expr( const CodeLocation & loc, const Type * res = nullptr ) |
---|
| 186 | : ParseNode( loc ), result( res ), env(), inferred() {} |
---|
[79f7875] | 187 | |
---|
[9e1d485] | 188 | Expr * set_extension( bool ex ) { extension = ex; return this; } |
---|
[79f7875] | 189 | |
---|
[69bafd2] | 190 | virtual const Expr * accept( Visitor & v ) const override = 0; |
---|
[79f7875] | 191 | private: |
---|
[23f99e1] | 192 | Expr * clone() const override = 0; |
---|
[f3cc5b6] | 193 | MUTATE_FRIEND |
---|
[264e691] | 194 | }; |
---|
| 195 | |
---|
[87701b6] | 196 | /// The application of a function to a set of parameters. |
---|
[54e41b3] | 197 | /// Post-resolver form of `UntypedExpr` |
---|
| 198 | class ApplicationExpr final : public Expr { |
---|
| 199 | public: |
---|
| 200 | ptr<Expr> func; |
---|
| 201 | std::vector<ptr<Expr>> args; |
---|
| 202 | |
---|
| 203 | ApplicationExpr( const CodeLocation & loc, const Expr * f, std::vector<ptr<Expr>> && as = {} ); |
---|
| 204 | |
---|
| 205 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 206 | private: |
---|
| 207 | ApplicationExpr * clone() const override { return new ApplicationExpr{ *this }; } |
---|
[f3cc5b6] | 208 | MUTATE_FRIEND |
---|
[54e41b3] | 209 | }; |
---|
| 210 | |
---|
| 211 | /// The application of a function to a set of parameters, pre-overload resolution. |
---|
| 212 | class UntypedExpr final : public Expr { |
---|
| 213 | public: |
---|
| 214 | ptr<Expr> func; |
---|
| 215 | std::vector<ptr<Expr>> args; |
---|
| 216 | |
---|
| 217 | UntypedExpr( const CodeLocation & loc, const Expr * f, std::vector<ptr<Expr>> && as = {} ) |
---|
| 218 | : Expr( loc ), func( f ), args( std::move(as) ) {} |
---|
| 219 | |
---|
| 220 | /// Creates a new dereference expression |
---|
| 221 | static UntypedExpr * createDeref( const CodeLocation & loc, Expr * arg ); |
---|
| 222 | /// Creates a new assignment expression |
---|
| 223 | static UntypedExpr * createAssign( const CodeLocation & loc, Expr * lhs, Expr * rhs ); |
---|
| 224 | |
---|
| 225 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 226 | private: |
---|
| 227 | UntypedExpr * clone() const override { return new UntypedExpr{ *this }; } |
---|
[f3cc5b6] | 228 | MUTATE_FRIEND |
---|
[54e41b3] | 229 | }; |
---|
| 230 | |
---|
| 231 | /// A name whose name is as-yet undetermined. |
---|
| 232 | /// May also be used to avoid name mangling in codegen phase. |
---|
| 233 | class NameExpr final : public Expr { |
---|
| 234 | public: |
---|
| 235 | std::string name; |
---|
| 236 | |
---|
| 237 | NameExpr( const CodeLocation & loc, const std::string & n ) : Expr( loc ), name( n ) {} |
---|
| 238 | |
---|
| 239 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 240 | private: |
---|
| 241 | NameExpr * clone() const override { return new NameExpr{ *this }; } |
---|
[f3cc5b6] | 242 | MUTATE_FRIEND |
---|
[54e41b3] | 243 | }; |
---|
| 244 | |
---|
| 245 | /// Address-of expression `&e` |
---|
| 246 | class AddressExpr final : public Expr { |
---|
| 247 | public: |
---|
| 248 | ptr<Expr> arg; |
---|
| 249 | |
---|
| 250 | AddressExpr( const CodeLocation & loc, const Expr * a ); |
---|
| 251 | |
---|
[b8524ca] | 252 | /// Generate AddressExpr wrapping given expression at same location |
---|
| 253 | AddressExpr( const Expr * a ) : AddressExpr( a->location, a ) {} |
---|
| 254 | |
---|
[54e41b3] | 255 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 256 | private: |
---|
| 257 | AddressExpr * clone() const override { return new AddressExpr{ *this }; } |
---|
[f3cc5b6] | 258 | MUTATE_FRIEND |
---|
[54e41b3] | 259 | }; |
---|
| 260 | |
---|
| 261 | /// GCC &&label |
---|
| 262 | /// https://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Labels-as-Values.html |
---|
| 263 | class LabelAddressExpr final : public Expr { |
---|
| 264 | public: |
---|
| 265 | Label arg; |
---|
| 266 | |
---|
| 267 | LabelAddressExpr( const CodeLocation & loc, Label && a ); |
---|
| 268 | |
---|
| 269 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 270 | private: |
---|
| 271 | LabelAddressExpr * clone() const override { return new LabelAddressExpr{ *this }; } |
---|
[f3cc5b6] | 272 | MUTATE_FRIEND |
---|
[54e41b3] | 273 | }; |
---|
| 274 | |
---|
| 275 | /// Whether a cast existed in the program source or not |
---|
| 276 | enum GeneratedFlag { ExplicitCast, GeneratedCast }; |
---|
| 277 | |
---|
| 278 | /// A type cast, e.g. `(int)e` |
---|
| 279 | class CastExpr final : public Expr { |
---|
| 280 | public: |
---|
| 281 | ptr<Expr> arg; |
---|
| 282 | GeneratedFlag isGenerated; |
---|
| 283 | |
---|
[87701b6] | 284 | CastExpr( const CodeLocation & loc, const Expr * a, const Type * to, |
---|
[54e41b3] | 285 | GeneratedFlag g = GeneratedCast ) : Expr( loc, to ), arg( a ), isGenerated( g ) {} |
---|
| 286 | /// Cast-to-void |
---|
| 287 | CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast ); |
---|
| 288 | |
---|
[b8524ca] | 289 | /// Wrap a cast expression around an existing expression (always generated) |
---|
| 290 | CastExpr( const Expr * a, const Type * to ) : CastExpr( a->location, a, to, GeneratedCast ) {} |
---|
| 291 | |
---|
| 292 | /// Wrap a cast-to-void expression around an existing expression (always generated) |
---|
| 293 | CastExpr( const Expr * a ) : CastExpr( a->location, a, GeneratedCast ) {} |
---|
| 294 | |
---|
[54e41b3] | 295 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 296 | private: |
---|
| 297 | CastExpr * clone() const override { return new CastExpr{ *this }; } |
---|
[f3cc5b6] | 298 | MUTATE_FRIEND |
---|
[54e41b3] | 299 | }; |
---|
| 300 | |
---|
| 301 | /// A cast to "keyword types", e.g. `(thread &)t` |
---|
| 302 | class KeywordCastExpr final : public Expr { |
---|
| 303 | public: |
---|
| 304 | ptr<Expr> arg; |
---|
| 305 | enum Target { Coroutine, Thread, Monitor, NUMBER_OF_TARGETS } target; |
---|
| 306 | |
---|
| 307 | KeywordCastExpr( const CodeLocation & loc, const Expr * a, Target t ) |
---|
| 308 | : Expr( loc ), arg( a ), target( t ) {} |
---|
| 309 | |
---|
| 310 | /// Get a name for the target type |
---|
| 311 | const std::string& targetString() const; |
---|
| 312 | |
---|
| 313 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 314 | private: |
---|
| 315 | KeywordCastExpr * clone() const override { return new KeywordCastExpr{ *this }; } |
---|
[f3cc5b6] | 316 | MUTATE_FRIEND |
---|
[54e41b3] | 317 | }; |
---|
| 318 | |
---|
| 319 | /// A virtual dynamic cast, e.g. `(virtual exception)e` |
---|
| 320 | class VirtualCastExpr final : public Expr { |
---|
| 321 | public: |
---|
| 322 | ptr<Expr> arg; |
---|
| 323 | |
---|
| 324 | VirtualCastExpr( const CodeLocation & loc, const Expr * a, const Type * to ) |
---|
| 325 | : Expr( loc, to ), arg( a ) {} |
---|
| 326 | |
---|
| 327 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 328 | private: |
---|
| 329 | VirtualCastExpr * clone() const override { return new VirtualCastExpr{ *this }; } |
---|
[f3cc5b6] | 330 | MUTATE_FRIEND |
---|
[54e41b3] | 331 | }; |
---|
| 332 | |
---|
| 333 | /// A member selection operation before expression resolution, e.g. `q.p` |
---|
| 334 | class UntypedMemberExpr final : public Expr { |
---|
| 335 | public: |
---|
| 336 | ptr<Expr> member; |
---|
| 337 | ptr<Expr> aggregate; |
---|
| 338 | |
---|
| 339 | UntypedMemberExpr( const CodeLocation & loc, const Expr * mem, const Expr * agg ) |
---|
| 340 | : Expr( loc ), member( mem ), aggregate( agg ) { assert( aggregate ); } |
---|
| 341 | |
---|
| 342 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 343 | private: |
---|
| 344 | UntypedMemberExpr * clone() const override { return new UntypedMemberExpr{ *this }; } |
---|
[f3cc5b6] | 345 | MUTATE_FRIEND |
---|
[54e41b3] | 346 | }; |
---|
| 347 | |
---|
| 348 | /// A member selection operation after expression resolution, e.g. `q.p` |
---|
| 349 | class MemberExpr final : public Expr { |
---|
| 350 | public: |
---|
| 351 | readonly<DeclWithType> member; |
---|
| 352 | ptr<Expr> aggregate; |
---|
| 353 | |
---|
| 354 | MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg ); |
---|
| 355 | |
---|
| 356 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 357 | private: |
---|
| 358 | MemberExpr * clone() const override { return new MemberExpr{ *this }; } |
---|
[f3cc5b6] | 359 | MUTATE_FRIEND |
---|
[ae265b55] | 360 | |
---|
| 361 | // Custructor overload meant only for AST conversion |
---|
| 362 | enum NoOpConstruction { NoOpConstructionChosen }; |
---|
| 363 | MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg, |
---|
| 364 | NoOpConstruction overloadSelector ); |
---|
| 365 | friend class ::ConverterOldToNew; |
---|
| 366 | friend class ::ConverterNewToOld; |
---|
[54e41b3] | 367 | }; |
---|
| 368 | |
---|
| 369 | /// A reference to a named variable. |
---|
| 370 | class VariableExpr final : public Expr { |
---|
| 371 | public: |
---|
| 372 | readonly<DeclWithType> var; |
---|
| 373 | |
---|
[546e712] | 374 | VariableExpr( const CodeLocation & loc ); |
---|
[54e41b3] | 375 | VariableExpr( const CodeLocation & loc, const DeclWithType * v ); |
---|
| 376 | |
---|
| 377 | /// generates a function pointer for a given function |
---|
| 378 | static VariableExpr * functionPointer( const CodeLocation & loc, const FunctionDecl * decl ); |
---|
| 379 | |
---|
| 380 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 381 | private: |
---|
| 382 | VariableExpr * clone() const override { return new VariableExpr{ *this }; } |
---|
[f3cc5b6] | 383 | MUTATE_FRIEND |
---|
[54e41b3] | 384 | }; |
---|
| 385 | |
---|
[c36298d] | 386 | /// A compile-time constant. |
---|
| 387 | /// Mostly carries C-source text from parse to code-gen, without interpretation. E.g. strings keep their outer quotes and never have backslashes interpreted. |
---|
| 388 | /// Integer constants get special treatment, e.g. for verifying array operations, when an integer constant occurs as the length of an array. |
---|
[54e41b3] | 389 | class ConstantExpr final : public Expr { |
---|
| 390 | public: |
---|
[c36298d] | 391 | // Representation of this constant, as it occurs in .cfa source and .cfa.cc result. |
---|
[54e41b3] | 392 | std::string rep; |
---|
| 393 | |
---|
[87701b6] | 394 | ConstantExpr( |
---|
[7870799] | 395 | const CodeLocation & loc, const Type * ty, const std::string & r, |
---|
[c36298d] | 396 | std::optional<unsigned long long> i ) |
---|
| 397 | : Expr( loc, ty ), rep( r ), ival( i ) {} |
---|
[87701b6] | 398 | |
---|
[c36298d] | 399 | /// Gets the integer value of this constant, if one is appropriate to its type. |
---|
| 400 | /// Throws a SemanticError if the type is not appropriate for value-as-integer. |
---|
| 401 | /// Suffers an assertion failure the type is appropriate but no integer value was supplied to the constructor. |
---|
[54e41b3] | 402 | long long int intValue() const; |
---|
| 403 | |
---|
| 404 | /// generates a boolean constant of the given bool |
---|
| 405 | static ConstantExpr * from_bool( const CodeLocation & loc, bool b ); |
---|
| 406 | /// generates an integer constant of the given int |
---|
| 407 | static ConstantExpr * from_int( const CodeLocation & loc, int i ); |
---|
| 408 | /// generates an integer constant of the given unsigned long int |
---|
| 409 | static ConstantExpr * from_ulong( const CodeLocation & loc, unsigned long i ); |
---|
| 410 | /// generates a null pointer value for the given type. void * if omitted. |
---|
| 411 | static ConstantExpr * null( const CodeLocation & loc, const Type * ptrType = nullptr ); |
---|
| 412 | |
---|
| 413 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 414 | private: |
---|
| 415 | ConstantExpr * clone() const override { return new ConstantExpr{ *this }; } |
---|
[f3cc5b6] | 416 | MUTATE_FRIEND |
---|
[c36298d] | 417 | |
---|
| 418 | std::optional<unsigned long long> ival; |
---|
| 419 | |
---|
| 420 | // Intended only for legacy support of roundtripping the old AST. |
---|
| 421 | // Captures the very-locally inferred type, before the resolver modifies the type of this ConstantExpression. |
---|
| 422 | // In the old AST it's constExpr->constant.type |
---|
| 423 | ptr<Type> underlyer; |
---|
| 424 | friend class ::ConverterOldToNew; |
---|
| 425 | friend class ::ConverterNewToOld; |
---|
[54e41b3] | 426 | }; |
---|
| 427 | |
---|
| 428 | /// sizeof expression, e.g. `sizeof(int)`, `sizeof 3+4` |
---|
| 429 | class SizeofExpr final : public Expr { |
---|
| 430 | public: |
---|
| 431 | ptr<Expr> expr; |
---|
| 432 | ptr<Type> type; |
---|
| 433 | |
---|
| 434 | SizeofExpr( const CodeLocation & loc, const Expr * e ); |
---|
| 435 | SizeofExpr( const CodeLocation & loc, const Type * t ); |
---|
| 436 | // deliberately no disambiguating overload for nullptr_t |
---|
| 437 | |
---|
| 438 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 439 | private: |
---|
| 440 | SizeofExpr * clone() const override { return new SizeofExpr{ *this }; } |
---|
[f3cc5b6] | 441 | MUTATE_FRIEND |
---|
[54e41b3] | 442 | }; |
---|
| 443 | |
---|
| 444 | /// alignof expression, e.g. `alignof(int)`, `alignof 3+4` |
---|
| 445 | class AlignofExpr final : public Expr { |
---|
| 446 | public: |
---|
| 447 | ptr<Expr> expr; |
---|
| 448 | ptr<Type> type; |
---|
| 449 | |
---|
| 450 | AlignofExpr( const CodeLocation & loc, const Expr * e ); |
---|
| 451 | AlignofExpr( const CodeLocation & loc, const Type * t ); |
---|
| 452 | // deliberately no disambiguating overload for nullptr_t |
---|
| 453 | |
---|
| 454 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 455 | private: |
---|
| 456 | AlignofExpr * clone() const override { return new AlignofExpr{ *this }; } |
---|
[f3cc5b6] | 457 | MUTATE_FRIEND |
---|
[54e41b3] | 458 | }; |
---|
| 459 | |
---|
| 460 | /// offsetof expression before resolver determines field, e.g. `offsetof(MyStruct, myfield)` |
---|
| 461 | class UntypedOffsetofExpr final : public Expr { |
---|
| 462 | public: |
---|
| 463 | ptr<Type> type; |
---|
| 464 | std::string member; |
---|
| 465 | |
---|
| 466 | UntypedOffsetofExpr( const CodeLocation & loc, const Type * ty, const std::string & mem ) |
---|
| 467 | : Expr( loc ), type( ty ), member( mem ) {} |
---|
| 468 | |
---|
| 469 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 470 | private: |
---|
| 471 | UntypedOffsetofExpr * clone() const override { return new UntypedOffsetofExpr{ *this }; } |
---|
[f3cc5b6] | 472 | MUTATE_FRIEND |
---|
[54e41b3] | 473 | }; |
---|
| 474 | |
---|
| 475 | /// offsetof expression after resolver determines field, e.g. `offsetof(MyStruct, myfield)` |
---|
| 476 | class OffsetofExpr final : public Expr { |
---|
| 477 | public: |
---|
| 478 | ptr<Type> type; |
---|
| 479 | readonly<DeclWithType> member; |
---|
| 480 | |
---|
| 481 | OffsetofExpr( const CodeLocation & loc, const Type * ty, const DeclWithType * mem ); |
---|
| 482 | |
---|
| 483 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 484 | private: |
---|
| 485 | OffsetofExpr * clone() const override { return new OffsetofExpr{ *this }; } |
---|
[f3cc5b6] | 486 | MUTATE_FRIEND |
---|
[54e41b3] | 487 | }; |
---|
| 488 | |
---|
| 489 | /// a pack of field-offsets for a generic type |
---|
| 490 | class OffsetPackExpr final : public Expr { |
---|
| 491 | public: |
---|
| 492 | ptr<StructInstType> type; |
---|
| 493 | |
---|
| 494 | OffsetPackExpr( const CodeLocation & loc, const StructInstType * ty ); |
---|
| 495 | |
---|
| 496 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 497 | private: |
---|
| 498 | OffsetPackExpr * clone() const override { return new OffsetPackExpr{ *this }; } |
---|
[f3cc5b6] | 499 | MUTATE_FRIEND |
---|
[54e41b3] | 500 | }; |
---|
| 501 | |
---|
| 502 | /// Variants of short-circuiting logical expression |
---|
| 503 | enum LogicalFlag { OrExpr, AndExpr }; |
---|
| 504 | |
---|
| 505 | /// Short-circuiting boolean expression (`&&` or `||`) |
---|
| 506 | class LogicalExpr final : public Expr { |
---|
| 507 | public: |
---|
| 508 | ptr<Expr> arg1; |
---|
| 509 | ptr<Expr> arg2; |
---|
| 510 | LogicalFlag isAnd; |
---|
| 511 | |
---|
| 512 | LogicalExpr( const CodeLocation & loc, const Expr * a1, const Expr * a2, LogicalFlag ia ); |
---|
| 513 | |
---|
| 514 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 515 | private: |
---|
| 516 | LogicalExpr * clone() const override { return new LogicalExpr{ *this }; } |
---|
[f3cc5b6] | 517 | MUTATE_FRIEND |
---|
[54e41b3] | 518 | }; |
---|
| 519 | |
---|
| 520 | /// Three-argument conditional e.g. `p ? a : b` |
---|
| 521 | class ConditionalExpr final : public Expr { |
---|
| 522 | public: |
---|
| 523 | ptr<Expr> arg1; |
---|
| 524 | ptr<Expr> arg2; |
---|
| 525 | ptr<Expr> arg3; |
---|
| 526 | |
---|
| 527 | ConditionalExpr( const CodeLocation & loc, const Expr * a1, const Expr * a2, const Expr * a3 ) |
---|
| 528 | : Expr( loc ), arg1( a1 ), arg2( a2 ), arg3( a3 ) {} |
---|
| 529 | |
---|
| 530 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 531 | private: |
---|
| 532 | ConditionalExpr * clone() const override { return new ConditionalExpr{ *this }; } |
---|
[f3cc5b6] | 533 | MUTATE_FRIEND |
---|
[54e41b3] | 534 | }; |
---|
| 535 | |
---|
| 536 | /// Comma expression e.g. `( a , b )` |
---|
| 537 | class CommaExpr final : public Expr { |
---|
| 538 | public: |
---|
| 539 | ptr<Expr> arg1; |
---|
| 540 | ptr<Expr> arg2; |
---|
| 541 | |
---|
[87701b6] | 542 | CommaExpr( const CodeLocation & loc, const Expr * a1, const Expr * a2 ) |
---|
[54e41b3] | 543 | : Expr( loc ), arg1( a1 ), arg2( a2 ) {} |
---|
| 544 | |
---|
| 545 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 546 | private: |
---|
| 547 | CommaExpr * clone() const override { return new CommaExpr{ *this }; } |
---|
[f3cc5b6] | 548 | MUTATE_FRIEND |
---|
[54e41b3] | 549 | }; |
---|
| 550 | |
---|
[264e691] | 551 | /// A type used as an expression (e.g. a type generator parameter) |
---|
| 552 | class TypeExpr final : public Expr { |
---|
| 553 | public: |
---|
| 554 | ptr<Type> type; |
---|
| 555 | |
---|
| 556 | TypeExpr( const CodeLocation & loc, const Type * t ) : Expr(loc), type(t) {} |
---|
| 557 | |
---|
[69bafd2] | 558 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
[264e691] | 559 | private: |
---|
| 560 | TypeExpr * clone() const override { return new TypeExpr{ *this }; } |
---|
[f3cc5b6] | 561 | MUTATE_FRIEND |
---|
[79f7875] | 562 | }; |
---|
| 563 | |
---|
[54e41b3] | 564 | /// A GCC "asm constraint operand" used in an asm statement, e.g. `[output] "=f" (result)`. |
---|
| 565 | /// https://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Machine-Constraints.html#Machine-Constraints |
---|
| 566 | class AsmExpr final : public Expr { |
---|
| 567 | public: |
---|
| 568 | ptr<Expr> inout; |
---|
[9b4f329] | 569 | ptr<Expr> constraint; |
---|
| 570 | ptr<Expr> operand; |
---|
| 571 | |
---|
| 572 | AsmExpr( const CodeLocation & loc, const Expr * io, const Expr * con, const Expr * op ) |
---|
| 573 | : Expr( loc ), inout( io ), constraint( con ), operand( op ) {} |
---|
| 574 | |
---|
| 575 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 576 | private: |
---|
| 577 | AsmExpr * clone() const override { return new AsmExpr{ *this }; } |
---|
| 578 | MUTATE_FRIEND |
---|
| 579 | }; |
---|
| 580 | |
---|
[17a0228a] | 581 | /// The application of a function to a set of parameters, along with a set of copy constructor |
---|
[9b4f329] | 582 | /// calls, one for each argument |
---|
| 583 | class ImplicitCopyCtorExpr final : public Expr { |
---|
| 584 | public: |
---|
| 585 | ptr<ApplicationExpr> callExpr; |
---|
| 586 | |
---|
| 587 | ImplicitCopyCtorExpr( const CodeLocation& loc, const ApplicationExpr * call ) |
---|
[d908563] | 588 | : Expr( loc, call->result ) { assert( call ); } |
---|
[9b4f329] | 589 | |
---|
| 590 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 591 | private: |
---|
| 592 | ImplicitCopyCtorExpr * clone() const override { return new ImplicitCopyCtorExpr{ *this }; } |
---|
| 593 | MUTATE_FRIEND |
---|
| 594 | }; |
---|
| 595 | |
---|
| 596 | /// Constructor in expression context, e.g. `int * x = alloc() { 42 };` |
---|
| 597 | class ConstructorExpr final : public Expr { |
---|
| 598 | public: |
---|
| 599 | ptr<Expr> callExpr; |
---|
| 600 | |
---|
| 601 | ConstructorExpr( const CodeLocation & loc, const Expr * call ); |
---|
| 602 | |
---|
| 603 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 604 | private: |
---|
| 605 | ConstructorExpr * clone() const override { return new ConstructorExpr{ *this }; } |
---|
| 606 | MUTATE_FRIEND |
---|
| 607 | }; |
---|
| 608 | |
---|
| 609 | /// A C99 compound literal, e.g. `(MyType){ a, b, c }` |
---|
| 610 | class CompoundLiteralExpr final : public Expr { |
---|
| 611 | public: |
---|
| 612 | ptr<Init> init; |
---|
| 613 | |
---|
| 614 | CompoundLiteralExpr( const CodeLocation & loc, const Type * t, const Init * i ); |
---|
| 615 | |
---|
| 616 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 617 | private: |
---|
| 618 | CompoundLiteralExpr * clone() const override { return new CompoundLiteralExpr{ *this }; } |
---|
| 619 | MUTATE_FRIEND |
---|
| 620 | }; |
---|
| 621 | |
---|
| 622 | /// A range, e.g. `3 ... 5` or `1~10` |
---|
| 623 | class RangeExpr final : public Expr { |
---|
| 624 | public: |
---|
| 625 | ptr<Expr> low; |
---|
| 626 | ptr<Expr> high; |
---|
| 627 | |
---|
| 628 | RangeExpr( const CodeLocation & loc, const Expr * l, const Expr * h ) |
---|
| 629 | : Expr( loc ), low( l ), high( h ) {} |
---|
| 630 | |
---|
| 631 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 632 | private: |
---|
| 633 | RangeExpr * clone() const override { return new RangeExpr{ *this }; } |
---|
| 634 | MUTATE_FRIEND |
---|
| 635 | }; |
---|
| 636 | |
---|
| 637 | /// A tuple expression before resolution, e.g. `[a, b, c]` |
---|
| 638 | class UntypedTupleExpr final : public Expr { |
---|
| 639 | public: |
---|
| 640 | std::vector<ptr<Expr>> exprs; |
---|
| 641 | |
---|
| 642 | UntypedTupleExpr( const CodeLocation & loc, std::vector<ptr<Expr>> && xs ) |
---|
| 643 | : Expr( loc ), exprs( std::move(xs) ) {} |
---|
| 644 | |
---|
| 645 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 646 | private: |
---|
| 647 | UntypedTupleExpr * clone() const override { return new UntypedTupleExpr{ *this }; } |
---|
| 648 | MUTATE_FRIEND |
---|
| 649 | }; |
---|
| 650 | |
---|
| 651 | /// A tuple expression after resolution, e.g. `[a, b, c]` |
---|
| 652 | class TupleExpr final : public Expr { |
---|
| 653 | public: |
---|
| 654 | std::vector<ptr<Expr>> exprs; |
---|
| 655 | |
---|
| 656 | TupleExpr( const CodeLocation & loc, std::vector<ptr<Expr>> && xs ); |
---|
| 657 | |
---|
| 658 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 659 | private: |
---|
| 660 | TupleExpr * clone() const override { return new TupleExpr{ *this }; } |
---|
| 661 | MUTATE_FRIEND |
---|
| 662 | }; |
---|
| 663 | |
---|
| 664 | /// An element selection operation on a tuple value, e.g. `t.3` after analysis |
---|
| 665 | class TupleIndexExpr final : public Expr { |
---|
| 666 | public: |
---|
| 667 | ptr<Expr> tuple; |
---|
| 668 | unsigned index; |
---|
| 669 | |
---|
| 670 | TupleIndexExpr( const CodeLocation & loc, const Expr * t, unsigned i ); |
---|
| 671 | |
---|
| 672 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 673 | private: |
---|
| 674 | TupleIndexExpr * clone() const override { return new TupleIndexExpr{ *this }; } |
---|
| 675 | MUTATE_FRIEND |
---|
| 676 | }; |
---|
| 677 | |
---|
[17a0228a] | 678 | /// A multiple- or mass-assignment operation, or a tuple ctor/dtor expression. |
---|
| 679 | /// multiple-assignment: both sides of the assignment have tuple type, |
---|
[9b4f329] | 680 | /// e.g. `[a, b, c] = [d, e, f];` |
---|
| 681 | /// mass-assignment: left-hand side has tuple type and right-hand side does not: |
---|
| 682 | /// e.g. `[a, b, c] = 42;` |
---|
| 683 | class TupleAssignExpr final : public Expr { |
---|
| 684 | public: |
---|
| 685 | ptr<StmtExpr> stmtExpr; |
---|
| 686 | |
---|
[17a0228a] | 687 | TupleAssignExpr( |
---|
| 688 | const CodeLocation & loc, std::vector<ptr<Expr>> && assigns, |
---|
[9b4f329] | 689 | std::vector<ptr<ObjectDecl>> && tempDecls ); |
---|
[17a0228a] | 690 | |
---|
[9b4f329] | 691 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
[20de6fb] | 692 | |
---|
| 693 | friend class ::ConverterOldToNew; |
---|
| 694 | |
---|
[9b4f329] | 695 | private: |
---|
| 696 | TupleAssignExpr * clone() const override { return new TupleAssignExpr{ *this }; } |
---|
[20de6fb] | 697 | TupleAssignExpr( const CodeLocation & loc, const Type * result, const StmtExpr * s ); |
---|
| 698 | |
---|
[9b4f329] | 699 | MUTATE_FRIEND |
---|
| 700 | }; |
---|
| 701 | |
---|
| 702 | /// A GCC "statement expression", e.g. `({ int x = 5; x })` |
---|
| 703 | class StmtExpr final : public Expr { |
---|
| 704 | public: |
---|
| 705 | ptr<CompoundStmt> stmts; |
---|
| 706 | std::vector<ptr<ObjectDecl>> returnDecls; ///< return variable(s) for statement expression |
---|
| 707 | std::vector<ptr<Expr>> dtors; ///< destructor(s) for return variable(s) |
---|
| 708 | |
---|
| 709 | StmtExpr( const CodeLocation & loc, const CompoundStmt * ss ); |
---|
| 710 | |
---|
| 711 | /// Set the result type of this StmtExpr based on its body |
---|
| 712 | void computeResult(); |
---|
| 713 | |
---|
| 714 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 715 | private: |
---|
| 716 | StmtExpr * clone() const override { return new StmtExpr{ *this }; } |
---|
| 717 | MUTATE_FRIEND |
---|
| 718 | }; |
---|
| 719 | |
---|
| 720 | /// An expression which must only be evaluated once |
---|
| 721 | class UniqueExpr final : public Expr { |
---|
| 722 | static unsigned long long nextId; |
---|
| 723 | public: |
---|
| 724 | ptr<Expr> expr; |
---|
| 725 | ptr<ObjectDecl> object; |
---|
| 726 | ptr<VariableExpr> var; |
---|
| 727 | unsigned long long id; |
---|
| 728 | |
---|
[d76f32c] | 729 | UniqueExpr( const CodeLocation & loc, const Expr * e, unsigned long long i = -1ull ); |
---|
[9b4f329] | 730 | |
---|
| 731 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 732 | private: |
---|
| 733 | UniqueExpr * clone() const override { return new UniqueExpr{ *this }; } |
---|
| 734 | MUTATE_FRIEND |
---|
| 735 | }; |
---|
| 736 | |
---|
| 737 | /// One option for resolving an initializer expression |
---|
| 738 | struct InitAlternative { |
---|
| 739 | ptr<Type> type; |
---|
| 740 | ptr<Designation> designation; |
---|
| 741 | |
---|
| 742 | InitAlternative() = default; |
---|
| 743 | InitAlternative( const Type * ty, const Designation * des ) : type( ty ), designation( des ) {} |
---|
| 744 | }; |
---|
| 745 | |
---|
| 746 | /// Pre-resolution initializer expression |
---|
| 747 | class UntypedInitExpr final : public Expr { |
---|
| 748 | public: |
---|
| 749 | ptr<Expr> expr; |
---|
[60aaa51d] | 750 | std::deque<InitAlternative> initAlts; |
---|
[9b4f329] | 751 | |
---|
[60aaa51d] | 752 | UntypedInitExpr( const CodeLocation & loc, const Expr * e, std::deque<InitAlternative> && as ) |
---|
[9b4f329] | 753 | : Expr( loc ), expr( e ), initAlts( std::move(as) ) {} |
---|
| 754 | |
---|
| 755 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 756 | private: |
---|
| 757 | UntypedInitExpr * clone() const override { return new UntypedInitExpr{ *this }; } |
---|
| 758 | MUTATE_FRIEND |
---|
| 759 | }; |
---|
| 760 | |
---|
| 761 | /// Post-resolution initializer expression |
---|
| 762 | class InitExpr final : public Expr { |
---|
| 763 | public: |
---|
| 764 | ptr<Expr> expr; |
---|
| 765 | ptr<Designation> designation; |
---|
| 766 | |
---|
| 767 | InitExpr( const CodeLocation & loc, const Expr * e, const Designation * des ) |
---|
| 768 | : Expr( loc, e->result ), expr( e ), designation( des ) {} |
---|
| 769 | |
---|
| 770 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 771 | private: |
---|
| 772 | InitExpr * clone() const override { return new InitExpr{ *this }; } |
---|
| 773 | MUTATE_FRIEND |
---|
| 774 | }; |
---|
| 775 | |
---|
| 776 | /// Expression containing a deleted identifier. |
---|
| 777 | /// Internal to resolver. |
---|
| 778 | class DeletedExpr final : public Expr { |
---|
| 779 | public: |
---|
| 780 | ptr<Expr> expr; |
---|
[e67991f] | 781 | readonly<Decl> deleteStmt; |
---|
[9b4f329] | 782 | |
---|
[e67991f] | 783 | DeletedExpr( const CodeLocation & loc, const Expr * e, const Decl * del ) |
---|
[9b4f329] | 784 | : Expr( loc, e->result ), expr( e ), deleteStmt( del ) { assert( expr->result ); } |
---|
| 785 | |
---|
| 786 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 787 | private: |
---|
| 788 | DeletedExpr * clone() const override { return new DeletedExpr{ *this }; } |
---|
| 789 | MUTATE_FRIEND |
---|
| 790 | }; |
---|
| 791 | |
---|
| 792 | /// Use of a default argument. |
---|
| 793 | /// Internal to resolver. |
---|
| 794 | class DefaultArgExpr final : public Expr { |
---|
| 795 | public: |
---|
| 796 | ptr<Expr> expr; |
---|
| 797 | |
---|
| 798 | DefaultArgExpr( const CodeLocation & loc, const Expr * e ) |
---|
| 799 | : Expr( loc, e->result ), expr( e ) { assert( e->result ); } |
---|
| 800 | |
---|
| 801 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 802 | private: |
---|
| 803 | DefaultArgExpr * clone() const override { return new DefaultArgExpr{ *this }; } |
---|
| 804 | MUTATE_FRIEND |
---|
| 805 | }; |
---|
| 806 | |
---|
| 807 | /// C11 _Generic expression |
---|
| 808 | class GenericExpr final : public Expr { |
---|
| 809 | public: |
---|
| 810 | /// One arm of the _Generic expr |
---|
| 811 | struct Association { |
---|
| 812 | ptr<Type> type; |
---|
| 813 | ptr<Expr> expr; |
---|
| 814 | |
---|
| 815 | Association() = default; |
---|
| 816 | // default case |
---|
| 817 | Association( const Expr * e ) : type(), expr( e ) {} |
---|
| 818 | // non-default case |
---|
| 819 | Association( const Type * t, const Expr * e ) : type( t ), expr( e ) {} |
---|
| 820 | }; |
---|
| 821 | |
---|
| 822 | ptr<Expr> control; |
---|
| 823 | std::vector<Association> associations; |
---|
| 824 | |
---|
| 825 | GenericExpr( const CodeLocation & loc, const Expr * ctrl, std::vector<Association> && assns ) |
---|
| 826 | : Expr( loc ), control( ctrl ), associations( std::move(assns) ) {} |
---|
| 827 | |
---|
| 828 | const Expr * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
| 829 | private: |
---|
| 830 | GenericExpr * clone() const override { return new GenericExpr{ *this }; } |
---|
| 831 | MUTATE_FRIEND |
---|
[54e41b3] | 832 | }; |
---|
[6d51bd7] | 833 | |
---|
[246c245] | 834 | |
---|
[79f7875] | 835 | } |
---|
| 836 | |
---|
[f3cc5b6] | 837 | #undef MUTATE_FRIEND |
---|
| 838 | |
---|
[79f7875] | 839 | // Local Variables: // |
---|
| 840 | // tab-width: 4 // |
---|
| 841 | // mode: c++ // |
---|
| 842 | // compile-command: "make install" // |
---|
| 843 | // End: // |
---|