@@ -1462,7 +1462,7 @@ namespace patchestry::ast {
14621462 std::vector< clang::QualType > param_types;
14631463 for (const auto &input : op.inputs ) {
14641464 if (type_builder ().GetSerializedTypes ().contains (input.type_key )) {
1465- param_types.push_back (type_builder ().GetSerializedTypes (). at (input.type_key ));
1465+ param_types.push_back (type_builder ().GetSerializedType (input.type_key ));
14661466 } else {
14671467 param_types.push_back (ctx.IntTy ); // Fallback
14681468 }
@@ -1471,7 +1471,7 @@ namespace patchestry::ast {
14711471 // Infer return type from op.type
14721472 clang::QualType return_type = ctx.VoidTy ;
14731473 if (op.type && type_builder ().GetSerializedTypes ().contains (*op.type )) {
1474- return_type = type_builder ().GetSerializedTypes (). at (*op.type );
1474+ return_type = type_builder ().GetSerializedType (*op.type );
14751475 }
14761476
14771477 // Build function type and pointer type
@@ -2494,12 +2494,12 @@ namespace patchestry::ast {
24942494 return {};
24952495 }
24962496
2497- if (!type_builder ().GetSerializedTypes ().contains (*op.type )) {
2497+ auto op_type = type_builder ().GetSerializedType (*op.type );
2498+ if (op_type.isNull ()) {
24982499 LOG (ERROR ) << " INT2FLOAT operation type is not serialized. key: " << op.key << " \n " ;
24992500 return {};
25002501 }
25012502
2502- const auto &op_type = type_builder ().GetSerializedTypes ().at (*op.type );
25032503 auto op_loc = SourceLocation (ctx.getSourceManager (), op.key );
25042504
25052505 auto *input_expr =
@@ -2569,13 +2569,13 @@ namespace patchestry::ast {
25692569 return {};
25702570 }
25712571
2572- if (!type_builder ().GetSerializedTypes ().contains (*op.type )) {
2572+ auto op_type = type_builder ().GetSerializedType (*op.type );
2573+ if (op_type.isNull ()) {
25732574 LOG (ERROR ) << " FLOAT2FLOAT operation type is not serialized. key: " << op.key
25742575 << " \n " ;
25752576 return {};
25762577 }
25772578
2578- const auto &op_type = type_builder ().GetSerializedTypes ().at (*op.type );
25792579 auto op_loc = SourceLocation (ctx.getSourceManager (), op.key );
25802580
25812581 auto *input_expr =
@@ -2607,14 +2607,14 @@ namespace patchestry::ast {
26072607 return { nullptr , false };
26082608 }
26092609
2610- if (!type_builder ().GetSerializedTypes ().contains (*op.type )) {
2610+ auto op_type = type_builder ().GetSerializedType (*op.type );
2611+ if (op_type.isNull ()) {
26112612 LOG (ERROR ) << " TRUNC operation type is not serialized. key: " << op.key << " \n " ;
26122613 return { nullptr , false };
26132614 }
26142615
26152616 auto merge_to_next = !op.output .has_value ();
26162617
2617- const auto &op_type = type_builder ().GetSerializedTypes ().at (*op.type );
26182618 auto op_loc = SourceLocation (ctx.getSourceManager (), op.key );
26192619
26202620 auto *input_expr =
@@ -2724,14 +2724,14 @@ namespace patchestry::ast {
27242724 return { nullptr , false };
27252725 }
27262726
2727- if (!type_builder ().GetSerializedTypes ().contains (*op.type )) {
2727+ auto op_type = type_builder ().GetSerializedType (*op.type );
2728+ if (op_type.isNull ()) {
27282729 LOG (ERROR ) << " PTRSUB operation type is not serialized. key: " << op.key << " \n " ;
27292730 return { nullptr , false };
27302731 }
27312732
27322733 auto merge_to_next = !op.output .has_value ();
27332734
2734- const auto &op_type = type_builder ().GetSerializedTypes ().at (*op.type );
27352735 auto op_loc = SourceLocation (ctx.getSourceManager (), op.key );
27362736
27372737 auto *input_expr =
@@ -2865,13 +2865,13 @@ namespace patchestry::ast {
28652865 return {};
28662866 }
28672867
2868- if (!type_builder ().GetSerializedTypes ().contains (*op.type )) {
2868+ auto op_type = type_builder ().GetSerializedType (*op.type );
2869+ if (op_type.isNull ()) {
28692870 LOG (ERROR ) << " Operation type does not exist in serialized list. key: " << op.key
28702871 << " \n " ;
28712872 return {};
28722873 }
28732874
2874- const auto &op_type = type_builder ().GetSerializedTypes ().at (*op.type );
28752875 auto op_loc = SourceLocation (ctx.getSourceManager (), op.key );
28762876 auto *input_expr =
28772877 clang::dyn_cast< clang::Expr >(create_varnode (ctx, function, op.inputs [0 ]));
@@ -2911,13 +2911,12 @@ namespace patchestry::ast {
29112911 return {};
29122912 }
29132913
2914- if (!type_builder ().GetSerializedTypes ().contains (*op.type )) {
2914+ auto var_type = type_builder ().GetSerializedType (*op.type );
2915+ if (var_type.isNull ()) {
29152916 LOG (ERROR ) << " Skipping, local/temporary variable type is not serialized. key: "
29162917 << op.key << " \n " ;
29172918 return {};
29182919 }
2919-
2920- const auto &var_type = type_builder ().GetSerializedTypes ()[*op.type ];
29212920 auto op_loc = SourceLocation (ctx.getSourceManager (), op.key );
29222921
29232922 std::string var_name = *op.name ;
0 commit comments