- Timestamp:
- Jun 23, 2026, 1:57:51 PM (26 hours ago)
- Branches:
- master
- Children:
- 9d7a19f
- Parents:
- 45d0e65
- Location:
- src
- Files:
-
- 10 edited
-
AST/Expr.cpp (modified) (18 diffs)
-
AST/Expr.hpp (modified) (2 diffs)
-
CodeGen/CodeGenerator.cpp (modified) (3 diffs)
-
GenPoly/Box.cpp (modified) (7 diffs)
-
Parser/ExpressionNode.cpp (modified) (2 diffs)
-
Parser/ParseNode.hpp (modified) (2 diffs)
-
Parser/lex.ll (modified) (3 diffs)
-
Parser/parser.yy (modified) (6 diffs)
-
ResolvExpr/CandidateFinder.cpp (modified) (2 diffs)
-
Virtual/Tables.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.cpp
r45d0e65 r366f5cd 11 11 // Last Modified By : Peter A. Buhr 12 12 // Created On : Wed May 18 13:56:00 2022 13 // Update Count : 1 213 // Update Count : 18 14 14 // 15 15 … … 46 46 // --- ApplicationExpr 47 47 48 ApplicationExpr::ApplicationExpr( const CodeLocation & loc, const Expr * f, 49 std::vector<ptr<Expr>> && as ) 50 : Expr( loc ), func( f ), args( std::move(as) ) { 48 ApplicationExpr::ApplicationExpr( const CodeLocation & loc, const Expr * f, std::vector<ptr<Expr>> && as ) 49 : Expr( loc ), func( f ), args( std::move(as) ) { 51 50 // ensure that `ApplicationExpr` result type is `FuncExpr` 52 51 const PointerType * pt = strict_dynamic_cast< const PointerType * >( f->result.get() ); … … 103 102 } 104 103 105 UntypedExpr * UntypedExpr::createCall( const CodeLocation & loc, 106 const std::string & name, std::vector<ptr<Expr>> && args ) { 104 UntypedExpr * UntypedExpr::createCall( const CodeLocation & loc, const std::string & name, std::vector<ptr<Expr>> && args ) { 107 105 return new UntypedExpr( loc, 108 106 new NameExpr( loc, name ), std::move( args ) ); … … 111 109 // --- VariableExpr 112 110 113 VariableExpr::VariableExpr( const CodeLocation & loc ) 114 : Expr( loc ), var( nullptr ) {} 115 116 VariableExpr::VariableExpr( const CodeLocation & loc, const DeclWithType * v ) 117 : Expr( loc ), var( v ) { 111 VariableExpr::VariableExpr( const CodeLocation & loc ) : Expr( loc ), var( nullptr ) {} 112 113 VariableExpr::VariableExpr( const CodeLocation & loc, const DeclWithType * v ) : Expr( loc ), var( v ) { 118 114 assert( var ); 119 115 assert( var->get_type() ); … … 130 126 } 131 127 132 VariableExpr * VariableExpr::functionPointer( 133 const CodeLocation & loc, const FunctionDecl * decl ) { 128 VariableExpr * VariableExpr::functionPointer( const CodeLocation & loc, const FunctionDecl * decl ) { 134 129 // wrap usually-determined result type in a pointer 135 130 VariableExpr * funcExpr = new VariableExpr{ loc, decl }; … … 178 173 } 179 174 180 AddressExpr::AddressExpr( const CodeLocation & loc, const Expr * a ) : 181 Expr( loc, addrExprType( loc, a ) ), arg( a ) 182 {} 175 AddressExpr::AddressExpr( const CodeLocation & loc, const Expr * a ) : Expr( loc, addrExprType( loc, a ) ), arg( a ) {} 183 176 184 177 // --- LabelAddressExpr … … 191 184 192 185 CastExpr::CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g, CastKind kind ) 193 : Expr( loc, new VoidType{} ), arg( a ), isGenerated( g ), kind( kind ) {}186 : Expr( loc, new VoidType{} ), arg( a ), isGenerated( g ), kind( kind ) {} 194 187 195 188 bool CastExpr::get_lvalue() const { … … 213 206 214 207 MemberExpr::MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg ) 215 : Expr( loc ), member( mem ), aggregate( agg ) {208 : Expr( loc ), member( mem ), aggregate( agg ) { 216 209 assert( member ); 217 210 assert( aggregate ); … … 249 242 250 243 ConstantExpr * ConstantExpr::from_bool( const CodeLocation & loc, bool b ) { 251 return new ConstantExpr{ 252 loc, new BasicType{ BasicKind::Bool }, b ? "1" : "0", (unsigned long long)b }; 244 return new ConstantExpr{ loc, new BasicType{ BasicKind::Bool }, b ? "1" : "0", (unsigned long long)b }; 253 245 } 254 246 255 247 ConstantExpr * ConstantExpr::from_int( const CodeLocation & loc, int i ) { 256 return new ConstantExpr{ 257 loc, new BasicType{ BasicKind::SignedInt }, std::to_string( i ), (unsigned long long)i }; 248 return new ConstantExpr{ loc, new BasicType{ BasicKind::SignedInt }, std::to_string( i ), (unsigned long long)i }; 258 249 } 259 250 260 251 ConstantExpr * ConstantExpr::from_ulong( const CodeLocation & loc, unsigned long i ) { 261 return new ConstantExpr{ 262 loc, new BasicType{ BasicKind::LongUnsignedInt }, std::to_string( i ), 263 (unsigned long long)i }; 252 return new ConstantExpr{ loc, new BasicType{ BasicKind::LongUnsignedInt }, std::to_string( i ), (unsigned long long)i }; 264 253 } 265 254 … … 274 263 275 264 ConstantExpr * ConstantExpr::null( const CodeLocation & loc, const Type * ptrType ) { 276 return new ConstantExpr{ 277 loc, ptrType ? ptrType : new PointerType{ new VoidType{} }, "0", (unsigned long long)0 }; 265 return new ConstantExpr{ loc, ptrType ? ptrType : new PointerType{ new VoidType{} }, "0", (unsigned long long)0 }; 278 266 } 279 267 280 268 // --- SizeofExpr 281 269 282 SizeofExpr::SizeofExpr( const CodeLocation & loc, const Type * type ) 283 : SizeofExpr( loc, type, nullptr ) {} 284 285 SizeofExpr::SizeofExpr( const CodeLocation & loc, const Type * type, const Type * result ) 286 : Expr( loc, result ), type( type ) {} 270 SizeofExpr::SizeofExpr( const CodeLocation & loc, const Type * type ) : SizeofExpr( loc, type, nullptr ) {} 271 272 SizeofExpr::SizeofExpr( const CodeLocation & loc, const Type * type, const Type * result ) : Expr( loc, result ), type( type ) {} 287 273 288 274 // --- AlignofExpr 289 275 290 AlignofExpr::AlignofExpr( const CodeLocation & loc, const Type * type ) 291 : AlignofExpr( loc, type, nullptr ) {} 292 293 AlignofExpr::AlignofExpr( const CodeLocation & loc, const Type * type, const Type * result ) 294 : Expr( loc, result ), type( type ) {} 276 AlignofExpr::AlignofExpr( const CodeLocation & loc, const Type * type, const Alignment kind ) : AlignofExpr( loc, type, nullptr, kind ) {} 277 278 AlignofExpr::AlignofExpr( const CodeLocation & loc, const Type * type, const Type * result, const Alignment kind ) 279 : Expr( loc, result ), type( type ), kind( kind ) {} 295 280 296 281 // --- CountofExpr 297 282 298 CountofExpr::CountofExpr( const CodeLocation & loc, const Type * t ) 299 : Expr( loc ), type( t ) {} 283 CountofExpr::CountofExpr( const CodeLocation & loc, const Type * t ) : Expr( loc ), type( t ) {} 300 284 301 285 // --- OffsetofExpr 302 286 303 287 OffsetofExpr::OffsetofExpr( const CodeLocation & loc, const Type * ty, const DeclWithType * mem, const Type * res ) 304 : Expr( loc, res ), type( ty ), member( mem ) {288 : Expr( loc, res ), type( ty ), member( mem ) { 305 289 assert( type ); 306 290 assert( member ); … … 309 293 // --- OffsetPackExpr 310 294 311 OffsetPackExpr::OffsetPackExpr( const CodeLocation & loc, const StructInstType * ty ) 312 : Expr( loc ), type( ty ) { 295 OffsetPackExpr::OffsetPackExpr( const CodeLocation & loc, const StructInstType * ty ) : Expr( loc ), type( ty ) { 313 296 assert( type ); 314 297 } … … 316 299 // --- LogicalExpr 317 300 318 LogicalExpr::LogicalExpr( 319 const CodeLocation & loc, const Expr * a1, const Expr * a2, LogicalFlag ia ) 320 : Expr( loc, new BasicType{ BasicKind::SignedInt } ), arg1( a1 ), arg2( a2 ), isAnd( ia ) {} 301 LogicalExpr::LogicalExpr( const CodeLocation & loc, const Expr * a1, const Expr * a2, LogicalFlag ia ) 302 : Expr( loc, new BasicType{ BasicKind::SignedInt } ), arg1( a1 ), arg2( a2 ), isAnd( ia ) {} 321 303 322 304 // --- CommaExpr … … 330 312 // --- ConstructorExpr 331 313 332 ConstructorExpr::ConstructorExpr( const CodeLocation & loc, const Expr * call ) 333 : Expr( loc ), callExpr( call ) { 314 ConstructorExpr::ConstructorExpr( const CodeLocation & loc, const Expr * call ) : Expr( loc ), callExpr( call ) { 334 315 // allow resolver to type a constructor used as an expression if it has the same type as its 335 316 // first argument … … 342 323 // --- CompoundLiteralExpr 343 324 344 CompoundLiteralExpr::CompoundLiteralExpr( const CodeLocation & loc, const Type * t, const Init * i ) 345 : Expr( loc ), init( i ) { 325 CompoundLiteralExpr::CompoundLiteralExpr( const CodeLocation & loc, const Type * t, const Init * i ) : Expr( loc ), init( i ) { 346 326 assert( t && i ); 347 327 result = t; … … 354 334 // --- TupleExpr 355 335 356 TupleExpr::TupleExpr( const CodeLocation & loc, std::vector<ptr<Expr>> && xs ) 357 : Expr( loc, Tuples::makeTupleType( xs ) ), exprs( xs ) {} 336 TupleExpr::TupleExpr( const CodeLocation & loc, std::vector<ptr<Expr>> && xs ) : Expr( loc, Tuples::makeTupleType( xs ) ), exprs( xs ) {} 358 337 359 338 // --- TupleIndexExpr 360 339 361 TupleIndexExpr::TupleIndexExpr( const CodeLocation & loc, const Expr * t, unsigned i ) 362 : Expr( loc ), tuple( t ), index( i ) { 340 TupleIndexExpr::TupleIndexExpr( const CodeLocation & loc, const Expr * t, unsigned i ) : Expr( loc ), tuple( t ), index( i ) { 363 341 const TupleType * type = strict_dynamic_cast< const TupleType * >( tuple->result.get() ); 364 342 assertf( type->size() > index, "TupleIndexExpr index out of bounds: tuple size %d, requested " … … 374 352 // --- TupleAssignExpr 375 353 376 TupleAssignExpr::TupleAssignExpr( 377 const CodeLocation & loc, std::vector<ptr<Expr>> && assigns, 378 std::vector<ptr<ObjectDecl>> && tempDecls ) 379 : Expr( loc, Tuples::makeTupleType( assigns ) ), stmtExpr() { 354 TupleAssignExpr::TupleAssignExpr( const CodeLocation & loc, std::vector<ptr<Expr>> && assigns, std::vector<ptr<ObjectDecl>> && tempDecls ) 355 : Expr( loc, Tuples::makeTupleType( assigns ) ), stmtExpr() { 380 356 // convert internally into a StmtExpr which contains the declarations and produces the tuple of 381 357 // the assignments … … 392 368 // --- StmtExpr 393 369 394 StmtExpr::StmtExpr( const CodeLocation & loc, const CompoundStmt * ss ) 395 : Expr( loc ), stmts( ss ) { computeResult(); } 370 StmtExpr::StmtExpr( const CodeLocation & loc, const CompoundStmt * ss ) : Expr( loc ), stmts( ss ) { computeResult(); } 396 371 397 372 void StmtExpr::computeResult() { … … 411 386 unsigned long long UniqueExpr::nextId = 0; 412 387 413 UniqueExpr::UniqueExpr( const CodeLocation & loc, const Expr * e, unsigned long long i ) 414 : Expr( loc, e->result ), expr( e ), id( i ) { 388 UniqueExpr::UniqueExpr( const CodeLocation & loc, const Expr * e, unsigned long long i ) : Expr( loc, e->result ), expr( e ), id( i ) { 415 389 assert( expr ); 416 390 if ( id == -1ull ) { -
src/AST/Expr.hpp
r45d0e65 r366f5cd 11 11 // Last Modified By : Peter A. Buhr 12 12 // Created On : Fri May 10 10:30:00 2019 13 // Update Count : 813 // Update Count : 24 14 14 // 15 15 … … 495 495 public: 496 496 ptr<Type> type; 497 498 AlignofExpr( const CodeLocation & loc, const Type * t ); 499 AlignofExpr( const CodeLocation & loc, const Type * t, const Type * r ); 497 enum Alignment { Alignof, __Alignof } kind; 498 499 AlignofExpr( const CodeLocation & loc, const Type * t, const Alignment kind ); 500 AlignofExpr( const CodeLocation & loc, const Type * t, const Type * r, const Alignment kind ); 500 501 501 502 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } -
src/CodeGen/CodeGenerator.cpp
r45d0e65 r366f5cd 10 10 // Created On : Tue Oct 17 15:54:00 2023 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 11 11:13:10202613 // Update Count : 2812 // Last Modified On : Tue Jun 23 13:42:15 2026 13 // Update Count : 34 14 14 // 15 15 … … 778 778 779 779 void CodeGenerator::postvisit( ast::AlignofExpr const * expr ) { 780 // Using the GCC extension to avoid changing the std to C11. 781 extension( expr ); 782 output << "__alignof__("; 780 extension( expr ); 781 output << (expr->kind ? "__alignof__(" : "_Alignof("); 783 782 if ( auto type = expr->type.as<ast::TypeofType>() ) { 784 783 type->expr->accept( *visitor ); … … 790 789 791 790 void CodeGenerator::postvisit( ast::CountofExpr const * expr ) { 792 assertf( ! options.genC, "CountofExpr should not reach code generation." );791 assertf( ! options.genC, "CountofExpr should not reach code generation." ); 793 792 extension( expr ); 794 793 output << "countof("; -
src/GenPoly/Box.cpp
r45d0e65 r366f5cd 10 10 // Created On : Thr Oct 6 13:39:00 2022 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Dec 14 17:42:17 202313 // Update Count : 712 // Last Modified On : Tue Jun 23 12:31:47 2026 13 // Update Count : 9 14 14 // 15 15 … … 265 265 kids.emplace_back( makeAlignTo( location, 266 266 derefVar( location, sizeofParam ), 267 new ast::AlignofExpr( location, ast::deepCopy( memberType ) )267 new ast::AlignofExpr( location, ast::deepCopy( memberType ), ast::AlignofExpr::Alignof ) 268 268 ) ); 269 269 } … … 285 285 kids.emplace_back( makeAssignMax( location, 286 286 derefVar( location, alignofParam ), 287 new ast::AlignofExpr( location, ast::deepCopy( memberType ) ) ) );287 new ast::AlignofExpr( location, ast::deepCopy( memberType ), ast::AlignofExpr::Alignof ) ) ); 288 288 } 289 289 // Make sure the type is end-padded to a multiple of its alignment. … … 343 343 kids.emplace_back( makeAssignMax( location, 344 344 derefVar( location, alignofParam ), 345 new ast::AlignofExpr( location, ast::deepCopy( memberType ) )345 new ast::AlignofExpr( location, ast::deepCopy( memberType ), ast::AlignofExpr::Alignof ) 346 346 ) ); 347 347 } … … 807 807 new ast::SizeofExpr( expr->location, ast::deepCopy( concrete ) ) ); 808 808 extraArgs.emplace_back( 809 new ast::AlignofExpr( expr->location, ast::deepCopy( concrete ) ) );809 new ast::AlignofExpr( expr->location, ast::deepCopy( concrete ), ast::AlignofExpr::Alignof ) ); 810 810 } 811 811 } … … 1723 1723 alignofName( typeName ), getLayoutCType( transUnit() ), 1724 1724 new ast::SingleInit( decl->location, 1725 new ast::AlignofExpr( decl->location, deepCopy( base ) )1725 new ast::AlignofExpr( decl->location, deepCopy( base ), ast::AlignofExpr::Alignof ) 1726 1726 ) 1727 1727 ); … … 2199 2199 new ast::SizeofExpr( location, ast::deepCopy( param ) ) ); 2200 2200 args.emplace_back( 2201 new ast::AlignofExpr( location, ast::deepCopy( param ) ) );2201 new ast::AlignofExpr( location, ast::deepCopy( param ), ast::AlignofExpr::Alignof ) ); 2202 2202 } 2203 2203 } -
src/Parser/ExpressionNode.cpp
r45d0e65 r366f5cd 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri May 1 11:07:48202613 // Update Count : 112 812 // Last Modified On : Mon Jun 22 16:30:56 2026 13 // Update Count : 1129 14 14 // 15 15 … … 591 591 static const char * OperName[] = { // must harmonize with OperKinds 592 592 // diadic 593 "SizeOf", "AlignOf", " OffsetOf", "?+?", "?-?", "?\\?", "?*?", "?/?", "?%?", "||", "&&",593 "SizeOf", "AlignOf", "__alignof", "OffsetOf", "?+?", "?-?", "?\\?", "?*?", "?/?", "?%?", "||", "&&", 594 594 "?|?", "?&?", "?^?", "Cast", "?<<?", "?>>?", "?<?", "?>?", "?<=?", "?>=?", "?==?", "?!=?", 595 595 "?=?", "?@=?", "?\\=?", "?*=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?", -
src/Parser/ParseNode.hpp
r45d0e65 r366f5cd 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Dec 9 17:39:34 202313 // Update Count : 94 512 // Last Modified On : Tue Jun 23 07:43:13 2026 13 // Update Count : 947 14 14 // 15 15 … … 94 94 enum class OperKinds { 95 95 // diadic 96 SizeOf, AlignOf, OffsetOf, Plus, Minus, Exp, Mul, Div, Mod, Or, And,96 SizeOf, AlignOf, __AlignOf, OffsetOf, Plus, Minus, Exp, Mul, Div, Mod, Or, And, 97 97 BitOr, BitAnd, Xor, Cast, LShift, RShift, LThan, GThan, LEThan, GEThan, Eq, Neq, 98 98 Assign, AtAssn, ExpAssn, MulAssn, DivAssn, ModAssn, PlusAssn, MinusAssn, LSAssn, RSAssn, AndAssn, ERAssn, OrAssn, -
src/Parser/lex.ll
r45d0e65 r366f5cd 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : T hu Jun 5 22:38:35 202513 * Update Count : 88 512 * Last Modified On : Tue Jun 23 07:44:07 2026 13 * Update Count : 888 14 14 */ 15 15 … … 56 56 string * build_postfix_name( string * name ); 57 57 58 char * yyfilename;59 string * strtext; // accumulate parts of character and string constant value58 char * yyfilename; 59 string * strtext; // accumulate parts of character and string constant value 60 60 61 61 #define RETURN_LOCN(x) yylval.tok.loc.file = yyfilename; yylval.tok.loc.line = yylineno; return( x ) … … 225 225 alignas { KEYWORD_RETURN(ALIGNAS); } // CFA 226 226 _Alignas { KEYWORD_RETURN(ALIGNAS); } // C11 227 alignof { KEYWORD_RETURN(ALIGNOF); } // C FA227 alignof { KEYWORD_RETURN(ALIGNOF); } // C23 228 228 _Alignof { KEYWORD_RETURN(ALIGNOF); } // C11 229 __alignof { KEYWORD_RETURN( ALIGNOF); } // GCC230 __alignof__ { KEYWORD_RETURN( ALIGNOF); } // GCC229 __alignof { KEYWORD_RETURN(__ALIGNOF); } // GCC 230 __alignof__ { KEYWORD_RETURN(__ALIGNOF); } // GCC 231 231 and { QKEYWORD_RETURN(WAND); } // CFA 232 232 asm { KEYWORD_RETURN(ASM); } -
src/Parser/parser.yy
r45d0e65 r366f5cd 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri May 1 11:01:45202613 // Update Count : 73 2012 // Last Modified On : Tue Jun 23 12:37:08 2026 13 // Update Count : 7350 14 14 // 15 15 … … 393 393 %token DISABLE ENABLE TRY THROW THROWRESUME AT // CFA 394 394 %token ASM // C99, extension ISO/IEC 9899:1999 Section J.5.10(1) 395 %token ALIGNAS ALIGNOF GENERIC STATICASSERT // C11395 %token ALIGNAS ALIGNOF __ALIGNOF GENERIC STATICASSERT // C11/C23 396 396 397 397 // names and constants: lexer differentiates between identifier and typedef names … … 432 432 %type<expr> constant 433 433 %type<expr> tuple tuple_expression_list 434 %type<oper> ptrref_operator unary_operator assignment_operator simple_assignment_operator compound_assignment_operator434 %type<oper> ptrref_operator alignof_operator unary_operator assignment_operator simple_assignment_operator compound_assignment_operator 435 435 %type<expr> primary_expression postfix_expression unary_expression 436 436 %type<expr> cast_expression_list cast_expression exponential_expression multiplicative_expression additive_expression … … 933 933 | SIZEOF '(' attribute_list type_no_function ')' 934 934 { $$ = new ExpressionNode( new ast::SizeofExpr( yylloc, maybeMoveBuildType( $4->addQualifiers( $3 ) ) ) ); } 935 | ALIGNOF unary_expression // GCC, variable alignment 936 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 ) ) ) ); } 937 | ALIGNOF '(' type_no_function ')' // GCC, type alignment 938 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 935 | alignof_operator unary_expression // GCC, variable alignment 936 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 ) ), 937 $1 == OperKinds::AlignOf ? ast::AlignofExpr::Alignof : ast::AlignofExpr::__Alignof ) ); } 938 | alignof_operator '(' type_no_function ')' // GCC, type alignment 939 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuildType( $3 ), 940 $1 == OperKinds::AlignOf ? ast::AlignofExpr::Alignof : ast::AlignofExpr::__Alignof ) ); } 939 941 940 942 // Cannot use rule "type", which includes cfa_abstract_function, for sizeof/alignof, because of S/R problems on … … 942 944 | SIZEOF '(' cfa_abstract_function ')' 943 945 { $$ = new ExpressionNode( new ast::SizeofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 944 | ALIGNOF '(' cfa_abstract_function ')'// GCC, type alignment945 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); }946 946 | alignof_operator '(' cfa_abstract_function ')' // GCC, type alignment 947 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuildType( $3 ), 948 $1 == OperKinds::AlignOf ? ast::AlignofExpr::Alignof : ast::AlignofExpr::__Alignof ) ); } 947 949 | OFFSETOF '(' type_no_function ',' identifier ')' 948 950 { $$ = new ExpressionNode( build_offsetOf( yylloc, $3, build_varref( yylloc, $5 ) ) ); } … … 956 958 | COUNTOF '(' type_no_function ')' 957 959 { $$ = new ExpressionNode( new ast::CountofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 960 ; 961 962 alignof_operator: 963 ALIGNOF { $$ = OperKinds::AlignOf; } 964 | __ALIGNOF { $$ = OperKinds::__AlignOf; } 958 965 ; 959 966 -
src/ResolvExpr/CandidateFinder.cpp
r45d0e65 r366f5cd 10 10 // Created On : Wed Jun 5 14:30:00 2019 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 9 11:30:11 202413 // Update Count : 512 // Last Modified On : Tue Jun 23 11:41:24 2026 13 // Update Count : 7 14 14 // 15 15 … … 1496 1496 const ast::Type * type = resolveTypeof( alignofExpr->type, context ); 1497 1497 const ast::Type * sizeType = context.global.sizeType.get(); 1498 addCandidate( 1499 new ast::AlignofExpr( alignofExpr->location, type, sizeType ), 1500 tenv ); 1498 addCandidate( new ast::AlignofExpr( alignofExpr->location, type, sizeType, alignofExpr->kind ), tenv ); 1501 1499 } 1502 1500 -
src/Virtual/Tables.cpp
r45d0e65 r366f5cd 9 9 // Author : Andrew Beach 10 10 // Created On : Mon Aug 31 11:11:00 2020 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Mar 11 10:40:00 202213 // Update Count : 311 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jun 23 12:31:00 2026 13 // Update Count : 4 14 14 // 15 15 … … 115 115 } else if ( std::string( "align" ) == field->name ) { 116 116 inits.push_back( new ast::SingleInit( location, 117 new ast::AlignofExpr( location, objectType )117 new ast::AlignofExpr( location, objectType, ast::AlignofExpr::Alignof ) 118 118 ) ); 119 119 } else {
Note:
See TracChangeset
for help on using the changeset viewer.