ir: do not cache variant type's alignment
[babeltrace.git] / formats / ctf / ir / event-types.c
index 74fa30473939440acf5266ce8353dabe7925827a..91104860483220924f34880caa195803d26ce2b8 100644 (file)
@@ -1906,6 +1906,46 @@ enum ctf_type_id bt_ctf_field_type_get_type_id(
        return type->declaration->id;
 }
 
+int bt_ctf_field_type_is_integer(struct bt_ctf_field_type *type)
+{
+       return bt_ctf_field_type_get_type_id(type) == CTF_TYPE_INTEGER;
+}
+
+int bt_ctf_field_type_is_floating_point(struct bt_ctf_field_type *type)
+{
+       return bt_ctf_field_type_get_type_id(type) == CTF_TYPE_FLOAT;
+}
+
+int bt_ctf_field_type_is_enumeration(struct bt_ctf_field_type *type)
+{
+       return bt_ctf_field_type_get_type_id(type) == CTF_TYPE_ENUM;
+}
+
+int bt_ctf_field_type_is_string(struct bt_ctf_field_type *type)
+{
+       return bt_ctf_field_type_get_type_id(type) == CTF_TYPE_STRING;
+}
+
+int bt_ctf_field_type_is_structure(struct bt_ctf_field_type *type)
+{
+       return bt_ctf_field_type_get_type_id(type) == CTF_TYPE_STRUCT;
+}
+
+int bt_ctf_field_type_is_array(struct bt_ctf_field_type *type)
+{
+       return bt_ctf_field_type_get_type_id(type) == CTF_TYPE_ARRAY;
+}
+
+int bt_ctf_field_type_is_sequence(struct bt_ctf_field_type *type)
+{
+       return bt_ctf_field_type_get_type_id(type) == CTF_TYPE_SEQUENCE;
+}
+
+int bt_ctf_field_type_is_variant(struct bt_ctf_field_type *type)
+{
+       return bt_ctf_field_type_get_type_id(type) == CTF_TYPE_VARIANT;
+}
+
 void bt_ctf_field_type_get(struct bt_ctf_field_type *type)
 {
        bt_get(type);
@@ -2464,8 +2504,6 @@ void bt_ctf_field_type_variant_freeze(struct bt_ctf_field_type *type)
        struct bt_ctf_field_type_variant *variant_type = container_of(
                type, struct bt_ctf_field_type_variant, parent);
 
-       /* Cache the alignment */
-       type->declaration->alignment = bt_ctf_field_type_get_alignment(type);
        generic_field_type_freeze(type);
        g_ptr_array_foreach(variant_type->fields,
                (GFunc) freeze_structure_field, NULL);
This page took 0.024229 seconds and 4 git commands to generate.