Changeset acb33f15 for src/Validate
- Timestamp:
- May 13, 2024, 10:26:52 AM (10 months ago)
- Branches:
- master
- Children:
- 31f4837
- Parents:
- 41c8312
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/ImplementEnumFunc.cpp
r41c8312 racb33f15 72 72 ast::DeclWithType* decl = declPtr.get_and_mutate(); 73 73 decl->attributes.push_back(new ast::Attribute("unused")); 74 }75 76 ast::ObjectDecl* dstParam() const {77 return new ast::ObjectDecl(getLocation(), "_dst",78 new ast::ReferenceType(new ast::EnumAttrType(79 ast::deepCopy(instType))));80 }81 82 ast::ObjectDecl* srcParam() const {83 return new ast::ObjectDecl(84 getLocation(), "_src",85 new ast::EnumAttrType(ast::deepCopy(instType)));86 74 } 87 75 … … 329 317 } 330 318 331 inline ast::EnumAttrType * getPosnType( const ast::EnumDecl * decl ) {332 return new ast::EnumAttrType(new ast::EnumInstType(decl), ast::EnumAttribute::Posn);333 }334 335 319 ast::ObjectDecl* EnumAttrFuncGenerator::genAttrArrayProto( 336 320 const ast::EnumAttribute attr, const CodeLocation& location, … … 360 344 func->location, 361 345 new ast::VariableExpr( func->location, func->params.front() ), 362 new ast::EnumAttrType( new ast::EnumInstType(decl), 363 ast::EnumAttribute::Posn))}); 346 new ast::BasicType( ast::BasicKind::UnsignedInt ), 347 ast::GeneratedFlag::ExplicitCast 348 )}); 364 349 func->stmts = new ast::CompoundStmt( 365 350 func->location, {new ast::ReturnStmt(func->location, untyped)}); … … 370 355 func->location, 371 356 new ast::VariableExpr(func->location, func->params.front()), 372 new ast:: EnumAttrType(new ast::EnumInstType(decl),373 ast::EnumAttribute::Posn));357 new ast::BasicType( ast::BasicKind::UnsignedInt ), 358 ast::GeneratedFlag::ExplicitCast); 374 359 func->stmts = new ast::CompoundStmt( 375 360 func->location, {new ast::ReturnStmt(func->location, castExpr)});
Note: See TracChangeset
for help on using the changeset viewer.