- Timestamp:
- Nov 23, 2024, 8:28:37 PM (16 months ago)
- Branches:
- master, stuck-waitfor-destruct
- Children:
- 956b389
- Parents:
- b006c51e (diff), de7b7a5 (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. - Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
rb006c51e r10a9479d 330 330 enum GeneratedFlag { ExplicitCast, GeneratedCast }; 331 331 332 /// Even within the basic cast expression there are variants: 333 /// CCast - C-Style Cast: A backwards compatable cast from C. 334 /// CoerceCast - Coercion Cast: Change the type without changing the value. 335 /// ReturnCast - Ascription Cast: Requires the given expression result type. 336 enum CastKind { CCast, CoerceCast, ReturnCast }; 337 332 338 /// A type cast, e.g. `(int)e` 333 339 class CastExpr final : public Expr { … … 336 342 GeneratedFlag isGenerated; 337 343 338 enum CastKind { 339 Default, // C 340 Coerce, // reinterpret cast 341 Return // overload selection 342 }; 343 344 CastKind kind = Default; 344 CastKind kind = CCast; 345 345 346 346 CastExpr( const CodeLocation & loc, const Expr * a, const Type * to, 347 GeneratedFlag g = GeneratedCast, CastKind kind = Default ) : Expr( loc, to ), arg( a ), isGenerated( g ), kind( kind ) {}347 GeneratedFlag g = GeneratedCast, CastKind kind = CCast ) : Expr( loc, to ), arg( a ), isGenerated( g ), kind( kind ) {} 348 348 /// Cast-to-void 349 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast, CastKind kind = Default );349 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast, CastKind kind = CCast ); 350 350 351 351 /// Wrap a cast expression around an existing expression (always generated) -
src/AST/Pass.hpp
rb006c51e r10a9479d 327 327 /// The Pass template handles what *before* and *after* means automatically 328 328 template< template<class...> class container_t = std::list > 329 struct WithStmtsToAdd {329 struct WithStmtsToAddX { 330 330 container_t< ptr<Stmt> > stmtsToAddBefore; 331 331 container_t< ptr<Stmt> > stmtsToAddAfter; 332 332 }; 333 334 struct WithStmtsToAdd : public WithStmtsToAddX<> {}; 333 335 334 336 /// Used if visitor requires added declarations before or after the current node. 335 337 /// The Pass template handles what *before* and *after* means automatically 336 338 template< template<class...> class container_t = std::list > 337 struct WithDeclsToAdd {339 struct WithDeclsToAddX { 338 340 container_t< ptr<Decl> > declsToAddBefore; 339 341 container_t< ptr<Decl> > declsToAddAfter; 340 342 }; 343 344 struct WithDeclsToAdd : public WithDeclsToAddX<> {}; 341 345 342 346 /// Use if visitation should stop at certain levels
Note:
See TracChangeset
for help on using the changeset viewer.