- File:
-
- 1 edited
-
src/Validate/ImplementEnumFunc.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/ImplementEnumFunc.cpp
r19313be5 raf746cc 156 156 const ast::ObjectDecl* dstParam, 157 157 const ast::ObjectDecl* srcParam) { 158 // const CodeLocation& location = func->location; 159 // auto& params = func->params; 160 // assert(2 == params.size()); 161 // auto dstParam = params.front().strict_as<ast::ObjectDecl>(); 162 // auto srcParam = params.back().strict_as<ast::ObjectDecl>(); 158 163 return new ast::CompoundStmt( 159 164 location, … … 296 301 {new ast::ObjectDecl(getLocation(), "_i", new ast::EnumInstType(decl))}, 297 302 {new ast::ObjectDecl(getLocation(), "_ret", 298 new ast::BasicType(ast::BasicKind::UnsignedInt))}); 303 new ast::EnumAttrType(new ast::EnumInstType(decl), 304 ast::EnumAttribute::Posn))}); 299 305 } 300 306 … … 305 311 {new ast::ObjectDecl( 306 312 getLocation(), "_ret", 307 new ast::PointerType(new ast::BasicType{ast::Basic Kind::Char}))});313 new ast::PointerType(new ast::BasicType{ast::BasicType::Char}))}); 308 314 } 309 315 … … 358 364 attr == ast::EnumAttribute::Value 359 365 ? decl->base 360 : new ast::PointerType(new ast::BasicType{ast::Basic Kind::Char}),366 : new ast::PointerType(new ast::BasicType{ast::BasicType::Char}), 361 367 ast::ConstantExpr::from_int(decl->location, decl->members.size()), 362 368 ast::LengthFlag::FixedLen, ast::DimensionFlag::DynamicDim); … … 434 440 435 441 auto addOneExpr = ast::UntypedExpr::createCall( location, 436 succ? "?+?": "?-?",442 "?+?", 437 443 {new ast::VariableExpr(location, param), 438 444 ast::ConstantExpr::from_int(location, 1)} … … 510 516 ast::EnumInstType enumInst(enumDecl->name); 511 517 enumInst.base = enumDecl; 512 518 // ast::EnumAttrType attr = ast::EnumAttrType(&enumInst); 519 // EnumAttrFuncGenerator gen(enumDecl, &enumInst functionNesting); 513 520 EnumAttrFuncGenerator gen(enumDecl, &enumInst, functionNesting); 514 521 gen.generateAndAppendFunctions(declsToAddAfter);
Note:
See TracChangeset
for help on using the changeset viewer.