@@ -442,22 +442,41 @@ void get_dependencies_from_generic_parameters(
442
442
class java_specialized_generic_class_typet : public java_class_typet
443
443
{
444
444
public:
445
+ typedef std::vector<reference_typet> generic_type_argumentst;
446
+
445
447
// / Build the specialised version of the specific class, with the specified
446
448
// / parameters and name.
447
449
// / \param generic_name: The new name for the class
448
450
// / (like Generic<java::Float>)
451
+ // / \param tag: The name for the original class (like java::Generic)
449
452
// / \param new_components: The specialised components
450
453
// / \return The newly constructed class.
451
454
java_specialized_generic_class_typet (
452
455
const irep_idt &generic_name,
453
- const struct_typet::componentst &new_components)
456
+ const irep_idt &tag,
457
+ const struct_typet::componentst &new_components,
458
+ const generic_type_argumentst &specialised_parameters)
454
459
{
455
460
set (ID_C_specialized_generic_java_class, true );
456
461
set (ID_name, " java::" + id2string (generic_name));
457
462
set (ID_base_name, id2string (generic_name));
458
463
components () = new_components;
459
- const std::string &class_tag = id2string (new_tag);
460
- set_tag (class_tag.substr (0 , class_tag.find (' <' )));
464
+ set_tag (tag);
465
+
466
+ generic_type_arguments () = specialised_parameters;
467
+ }
468
+
469
+ // / \return vector of type variables
470
+ const generic_type_argumentst &generic_type_arguments () const
471
+ {
472
+ return (const generic_type_argumentst &)(find (ID_type_variables).get_sub ());
473
+ }
474
+
475
+ private:
476
+ // / \return vector of type variables
477
+ generic_type_argumentst &generic_type_arguments ()
478
+ {
479
+ return (generic_type_argumentst &)(add (ID_type_variables).get_sub ());
461
480
}
462
481
};
463
482
0 commit comments