Changeset d945be9 for src/AST


Ignore:
Timestamp:
Nov 20, 2024, 9:46:17 AM (12 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
1cd2839, bdf40650
Parents:
7c80a86 (diff), ecf3812 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    r7c80a86 rd945be9  
    330330enum GeneratedFlag { ExplicitCast, GeneratedCast };
    331331
     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.
     336enum CastKind { CCast, CoerceCast, ReturnCast };
     337
    332338/// A type cast, e.g. `(int)e`
    333339class CastExpr final : public Expr {
     
    336342        GeneratedFlag isGenerated;
    337343
    338         enum CastKind {
    339                 Default, // C
    340                 Coerce, // reinterpret cast
    341                 Return  // overload selection
    342         };
    343 
    344         CastKind kind = Default;
     344        CastKind kind = CCast;
    345345
    346346        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 ) {}
    348348        /// 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 );
    350350
    351351        /// Wrap a cast expression around an existing expression (always generated)
Note: See TracChangeset for help on using the changeset viewer.