- Timestamp:
- Aug 4, 2024, 9:49:25 PM (5 months ago)
- Branches:
- master
- Children:
- 7db4fcd4
- Parents:
- 7ab24fef
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/TranslateEnumRange.cpp
r7ab24fef r5f210c0 51 51 // it wraps around and become unsigned max 52 52 ast::UntypedExpr * condition = ast::UntypedExpr::createCall( location, 53 "?<=?",53 stmt->is_inc? "?<=?": "?>=?", 54 54 { new ast::NameExpr( location, indexName ), 55 ast::UntypedExpr::createCall( location, "upperBound", {} ) }); 55 stmt->is_inc? 56 ast::UntypedExpr::createCall( location, "upperBound", {} ): 57 ast::UntypedExpr::createCall( location, "lowerBound", {} ) 58 }); 56 59 auto increment = ast::UntypedExpr::createCall( location, 57 60 stmt->is_inc? "succ_unsafe": "pred_unsafe", -
src/Validate/ImplementEnumFunc.cpp
r7ab24fef r5f210c0 25 25 : decl(decl), 26 26 functionNesting{functionNesting}, 27 // quasi_void_decl(new ast::StructDecl(decl->location,28 // "quasi_void", ast::AggregateDecl::Struct,29 // {}, ast::Linkage::AutoGen)),30 27 proto_linkage{ast::Linkage::Cforall} {} 31 28 … … 194 191 {new ast::ObjectDecl(getLocation(), "_i", new ast::EnumInstType(decl))}, 195 192 {new ast::ObjectDecl(getLocation(), "_ret", 196 new ast::BasicType(ast::BasicKind:: UnsignedInt))});193 new ast::BasicType(ast::BasicKind::SignedInt))}); 197 194 } 198 195 … … 229 226 return genProto( 230 227 "fromInt_unsafe", 231 {new ast::ObjectDecl(getLocation(), "_i", new ast::BasicType(ast::BasicKind:: UnsignedInt))},228 {new ast::ObjectDecl(getLocation(), "_i", new ast::BasicType(ast::BasicKind::SignedInt))}, 232 229 {new ast::ObjectDecl(getLocation(), "_ret", new ast::EnumInstType(decl))} 233 230 ); … … 238 235 "fromInstance", 239 236 {new ast::ObjectDecl(getLocation(), "_i", new ast::EnumInstType(decl))}, 240 {new ast::ObjectDecl(getLocation(), "_ret", new ast::BasicType(ast::BasicKind:: UnsignedInt))}237 {new ast::ObjectDecl(getLocation(), "_ret", new ast::BasicType(ast::BasicKind::SignedInt))} 241 238 ); 242 239 } … … 285 282 func->location, 286 283 new ast::VariableExpr(func->location, param), 287 new ast::BasicType(ast::BasicKind:: UnsignedInt),284 new ast::BasicType(ast::BasicKind::SignedInt), 288 285 ast::GeneratedFlag::ExplicitCast 289 286 ); … … 383 380 func->location, 384 381 new ast::VariableExpr( func->location, func->params.front() ), 385 new ast::BasicType( ast::BasicKind:: UnsignedInt ),382 new ast::BasicType( ast::BasicKind::SignedInt ), 386 383 ast::GeneratedFlag::ExplicitCast 387 384 )}); … … 407 404 func->location, 408 405 new ast::VariableExpr(func->location, func->params.front()), 409 new ast::BasicType( ast::BasicKind:: UnsignedInt ),406 new ast::BasicType( ast::BasicKind::SignedInt ), 410 407 ast::GeneratedFlag::ExplicitCast); 411 408 func->stmts = new ast::CompoundStmt(
Note: See TracChangeset
for help on using the changeset viewer.