- File:
-
- 1 edited
-
src/Validate/ImplementEnumFunc.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/ImplementEnumFunc.cpp
r748c751 r7a780ad 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::BasicType::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 Type::Char}))});313 new ast::PointerType(new ast::BasicType{ast::BasicKind::Char}))}); 308 314 } 309 315 … … 358 364 attr == ast::EnumAttribute::Value 359 365 ? decl->base 360 : new ast::PointerType(new ast::BasicType{ast::Basic Type::Char}),366 : new ast::PointerType(new ast::BasicType{ast::BasicKind::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)}
Note:
See TracChangeset
for help on using the changeset viewer.