2 * SPDX-License-Identifier: MIT
4 * Copyright 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * Common Trace Format Metadata Semantic Validator.
9 #define BT_COMP_LOG_SELF_COMP (log_cfg->self_comp)
10 #define BT_LOG_OUTPUT_LEVEL (log_cfg->log_level)
11 #define BT_LOG_TAG "PLUGIN/CTF/META/SEMANTIC-VALIDATOR-VISITOR"
12 #include "logging/comp-logging.h"
18 #include "common/assert.h"
22 #include "common/list.h"
23 #include "scanner.hpp"
25 #include "logging.hpp"
27 #define _bt_list_first_entry(ptr, type, member) bt_list_entry((ptr)->next, type, member)
29 static int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
30 struct meta_log_config
*log_cfg
);
32 static int ctf_visitor_unary_expression(int, struct ctf_node
*node
, struct meta_log_config
*log_cfg
)
34 struct ctf_node
*iter
;
35 int is_ctf_exp
= 0, is_ctf_exp_left
= 0;
37 switch (node
->parent
->type
) {
38 case NODE_CTF_EXPRESSION
:
40 bt_list_for_each_entry (iter
, &node
->parent
->u
.ctf_expression
.left
, siblings
) {
44 * We are a left child of a ctf expression.
45 * We are only allowed to be a string.
47 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
48 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
50 "Left child of a CTF expression is only allowed to be a string.");
56 /* Right child of a ctf expression can be any type of unary exp. */
58 case NODE_TYPE_DECLARATOR
:
60 * We are the length of a type declarator.
62 switch (node
->u
.unary_expression
.type
) {
63 case UNARY_UNSIGNED_CONSTANT
:
67 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
69 "Children of field class declarator and `enum` can only be unsigned numeric constants or references to fields (e.g., `a.b.c`).");
76 * We are the size of a struct align attribute.
78 switch (node
->u
.unary_expression
.type
) {
79 case UNARY_UNSIGNED_CONSTANT
:
82 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
84 "Structure alignment attribute can only be an unsigned numeric constant.");
90 /* The enumerator's parent has validated its validity already. */
93 case NODE_UNARY_EXPRESSION
:
95 * We disallow nested unary expressions and "sbrac" unary
98 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
99 "Nested unary expressions not allowed (`()` and `[]`).");
110 case NODE_TYPEALIAS_TARGET
:
111 case NODE_TYPEALIAS_ALIAS
:
113 case NODE_TYPE_SPECIFIER
:
115 case NODE_FLOATING_POINT
:
119 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
125 switch (node
->u
.unary_expression
.link
) {
126 case UNARY_LINK_UNKNOWN
:
127 /* We don't allow empty link except on the first node of the list */
129 _bt_list_first_entry(is_ctf_exp_left
? &node
->parent
->u
.ctf_expression
.left
:
130 &node
->parent
->u
.ctf_expression
.right
,
131 struct ctf_node
, siblings
) != node
) {
132 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
134 "Empty link is not allowed except on first node of unary expression (need to separate nodes with `.` or `->`).");
139 case UNARY_ARROWLINK
:
140 /* We only allow -> and . links between children of ctf_expression. */
141 if (node
->parent
->type
!= NODE_CTF_EXPRESSION
) {
142 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
143 node
->lineno
, "Links `.` and `->` are only allowed as children of CTF expression.");
147 * Only strings can be separated linked by . or ->.
148 * This includes "", '' and non-quoted identifiers.
150 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
151 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
153 "Links `.` and `->` are only allowed to separate strings and identifiers.");
156 /* We don't allow link on the first node of the list */
158 _bt_list_first_entry(is_ctf_exp_left
? &node
->parent
->u
.ctf_expression
.left
:
159 &node
->parent
->u
.ctf_expression
.right
,
160 struct ctf_node
, siblings
) == node
) {
161 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
163 "Links `.` and `->` are not allowed before first node of the unary expression list.");
167 case UNARY_DOTDOTDOT
:
168 /* We only allow ... link between children of enumerator. */
169 if (node
->parent
->type
!= NODE_ENUMERATOR
) {
170 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
171 "Link `...` is only allowed within enumerator.");
174 /* We don't allow link on the first node of the list */
175 if (_bt_list_first_entry(&node
->parent
->u
.enumerator
.values
, struct ctf_node
, siblings
) ==
177 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
179 "Link `...` is not allowed on the first node of the unary expression list.");
184 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
, "Unknown expression link type: type=%d",
185 node
->u
.unary_expression
.link
);
191 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
192 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
193 node_type(node
), node_type(node
->parent
));
194 return -EINVAL
; /* Incoherent structure */
197 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
198 "Semantic error: node-type=%s, parent-node-type=%s",
199 node_type(node
), node_type(node
->parent
));
200 return -EPERM
; /* Structure not allowed */
203 static int ctf_visitor_field_class_specifier_list(int, struct ctf_node
*node
,
204 struct meta_log_config
*log_cfg
)
206 switch (node
->parent
->type
) {
207 case NODE_CTF_EXPRESSION
:
208 case NODE_TYPE_DECLARATOR
:
210 case NODE_TYPEALIAS_TARGET
:
211 case NODE_TYPEALIAS_ALIAS
:
213 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
223 case NODE_UNARY_EXPRESSION
:
225 case NODE_TYPE_SPECIFIER
:
226 case NODE_TYPE_SPECIFIER_LIST
:
228 case NODE_FLOATING_POINT
:
231 case NODE_ENUMERATOR
:
239 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
240 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
241 node_type(node
), node_type(node
->parent
));
242 return -EINVAL
; /* Incoherent structure */
245 static int ctf_visitor_field_class_specifier(int, struct ctf_node
*node
,
246 struct meta_log_config
*log_cfg
)
248 switch (node
->parent
->type
) {
249 case NODE_TYPE_SPECIFIER_LIST
:
252 case NODE_CTF_EXPRESSION
:
253 case NODE_TYPE_DECLARATOR
:
255 case NODE_TYPEALIAS_TARGET
:
256 case NODE_TYPEALIAS_ALIAS
:
258 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
266 case NODE_UNARY_EXPRESSION
:
268 case NODE_TYPE_SPECIFIER
:
270 case NODE_FLOATING_POINT
:
273 case NODE_ENUMERATOR
:
281 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
282 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
283 node_type(node
), node_type(node
->parent
));
284 return -EINVAL
; /* Incoherent structure */
287 static int ctf_visitor_field_class_declarator(int depth
, struct ctf_node
*node
,
288 struct meta_log_config
*log_cfg
)
291 struct ctf_node
*iter
;
295 switch (node
->parent
->type
) {
296 case NODE_TYPE_DECLARATOR
:
298 * A nested field class declarator is not allowed to
301 if (!bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
304 case NODE_TYPEALIAS_TARGET
:
306 case NODE_TYPEALIAS_ALIAS
:
308 * Only accept alias name containing:
310 * - identifier * (any number of pointers)
311 * NOT accepting alias names containing [] (would otherwise
312 * cause semantic clash for later declarations of
313 * arrays/sequences of elements, where elements could be
314 * arrays/sequences themselves (if allowed in field class alias).
315 * NOT accepting alias with identifier. The declarator should
316 * be either empty or contain pointer(s).
318 if (node
->u
.field_class_declarator
.type
== TYPEDEC_NESTED
)
320 bt_list_for_each_entry (iter
,
321 &node
->parent
->u
.field_class_alias_name
.field_class_specifier_list
322 ->u
.field_class_specifier_list
.head
,
324 switch (iter
->u
.field_class_specifier
.type
) {
325 case TYPESPEC_FLOATING_POINT
:
326 case TYPESPEC_INTEGER
:
327 case TYPESPEC_STRING
:
328 case TYPESPEC_STRUCT
:
329 case TYPESPEC_VARIANT
:
331 if (bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
338 if (node
->u
.field_class_declarator
.type
== TYPEDEC_ID
&&
339 node
->u
.field_class_declarator
.u
.id
)
343 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
353 case NODE_CTF_EXPRESSION
:
354 case NODE_UNARY_EXPRESSION
:
356 case NODE_TYPE_SPECIFIER
:
358 case NODE_FLOATING_POINT
:
361 case NODE_ENUMERATOR
:
369 bt_list_for_each_entry (iter
, &node
->u
.field_class_declarator
.pointers
, siblings
) {
370 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
375 switch (node
->u
.field_class_declarator
.type
) {
380 if (node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
) {
381 ret
= _ctf_visitor_semantic_check(
382 depth
+ 1, node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
, log_cfg
);
386 if (!node
->u
.field_class_declarator
.u
.nested
.abstract_array
) {
387 bt_list_for_each_entry (iter
, &node
->u
.field_class_declarator
.u
.nested
.length
,
389 if (iter
->type
!= NODE_UNARY_EXPRESSION
) {
390 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
391 node
->lineno
, "Expecting unary expression as length: node-type=%s",
395 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
400 if (node
->parent
->type
== NODE_TYPEALIAS_TARGET
) {
401 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
403 "Abstract array declarator not permitted as target of field class alias.");
407 if (node
->u
.field_class_declarator
.bitfield_len
) {
408 ret
= _ctf_visitor_semantic_check(depth
+ 1,
409 node
->u
.field_class_declarator
.bitfield_len
, log_cfg
);
415 case TYPEDEC_UNKNOWN
:
417 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
, "Unknown field class declarator: type=%d",
418 node
->u
.field_class_declarator
.type
);
425 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
426 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
427 node_type(node
), node_type(node
->parent
));
428 return -EINVAL
; /* Incoherent structure */
431 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
432 "Semantic error: node-type=%s, parent-node-type=%s",
433 node_type(node
), node_type(node
->parent
));
434 return -EPERM
; /* Structure not allowed */
437 static int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
438 struct meta_log_config
*log_cfg
)
441 struct ctf_node
*iter
;
446 switch (node
->type
) {
448 bt_list_for_each_entry (iter
, &node
->u
.root
.declaration_list
, siblings
) {
449 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
453 bt_list_for_each_entry (iter
, &node
->u
.root
.trace
, siblings
) {
454 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
458 bt_list_for_each_entry (iter
, &node
->u
.root
.stream
, siblings
) {
459 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
463 bt_list_for_each_entry (iter
, &node
->u
.root
.event
, siblings
) {
464 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
471 switch (node
->parent
->type
) {
478 bt_list_for_each_entry (iter
, &node
->u
.event
.declaration_list
, siblings
) {
479 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
485 switch (node
->parent
->type
) {
492 bt_list_for_each_entry (iter
, &node
->u
.stream
.declaration_list
, siblings
) {
493 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
499 switch (node
->parent
->type
) {
506 bt_list_for_each_entry (iter
, &node
->u
.env
.declaration_list
, siblings
) {
507 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
513 switch (node
->parent
->type
) {
520 bt_list_for_each_entry (iter
, &node
->u
.trace
.declaration_list
, siblings
) {
521 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
527 switch (node
->parent
->type
) {
534 bt_list_for_each_entry (iter
, &node
->u
.clock
.declaration_list
, siblings
) {
535 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
541 switch (node
->parent
->type
) {
548 bt_list_for_each_entry (iter
, &node
->u
.callsite
.declaration_list
, siblings
) {
549 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
555 case NODE_CTF_EXPRESSION
:
556 switch (node
->parent
->type
) {
564 case NODE_FLOATING_POINT
:
569 case NODE_CTF_EXPRESSION
:
570 case NODE_UNARY_EXPRESSION
:
572 case NODE_TYPEALIAS_TARGET
:
573 case NODE_TYPEALIAS_ALIAS
:
574 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
576 case NODE_TYPE_SPECIFIER
:
577 case NODE_TYPE_SPECIFIER_LIST
:
579 case NODE_TYPE_DECLARATOR
:
580 case NODE_ENUMERATOR
:
589 bt_list_for_each_entry (iter
, &node
->u
.ctf_expression
.left
, siblings
) {
590 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
594 bt_list_for_each_entry (iter
, &node
->u
.ctf_expression
.right
, siblings
) {
595 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
601 case NODE_UNARY_EXPRESSION
:
602 return ctf_visitor_unary_expression(depth
, node
, log_cfg
);
605 switch (node
->parent
->type
) {
614 case NODE_CTF_EXPRESSION
:
615 case NODE_UNARY_EXPRESSION
:
617 case NODE_TYPEALIAS_TARGET
:
618 case NODE_TYPEALIAS_ALIAS
:
620 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
621 case NODE_TYPE_SPECIFIER
:
622 case NODE_TYPE_SPECIFIER_LIST
:
624 case NODE_TYPE_DECLARATOR
:
625 case NODE_FLOATING_POINT
:
628 case NODE_ENUMERATOR
:
638 ret
= _ctf_visitor_semantic_check(
639 depth
+ 1, node
->u
.field_class_def
.field_class_specifier_list
, log_cfg
);
642 bt_list_for_each_entry (iter
, &node
->u
.field_class_def
.field_class_declarators
, siblings
) {
643 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
649 case NODE_TYPEALIAS_TARGET
:
653 switch (node
->parent
->type
) {
661 ret
= _ctf_visitor_semantic_check(
662 depth
+ 1, node
->u
.field_class_alias_target
.field_class_specifier_list
, log_cfg
);
666 bt_list_for_each_entry (iter
, &node
->u
.field_class_alias_target
.field_class_declarators
,
668 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
673 if (nr_declarators
> 1) {
674 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
676 "Too many declarators in field class alias's name (maximum is 1): count=%d",
683 case NODE_TYPEALIAS_ALIAS
:
687 switch (node
->parent
->type
) {
695 ret
= _ctf_visitor_semantic_check(
696 depth
+ 1, node
->u
.field_class_alias_name
.field_class_specifier_list
, log_cfg
);
700 bt_list_for_each_entry (iter
, &node
->u
.field_class_alias_name
.field_class_declarators
,
702 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
707 if (nr_declarators
> 1) {
708 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
710 "Too many declarators in field class alias's name (maximum is 1): count=%d",
718 switch (node
->parent
->type
) {
727 case NODE_CTF_EXPRESSION
:
728 case NODE_UNARY_EXPRESSION
:
730 case NODE_TYPEALIAS_TARGET
:
731 case NODE_TYPEALIAS_ALIAS
:
733 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
734 case NODE_TYPE_SPECIFIER
:
735 case NODE_TYPE_SPECIFIER_LIST
:
737 case NODE_TYPE_DECLARATOR
:
738 case NODE_FLOATING_POINT
:
741 case NODE_ENUMERATOR
:
750 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
.field_class_alias
.target
, log_cfg
);
753 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
.field_class_alias
.alias
, log_cfg
);
758 case NODE_TYPE_SPECIFIER_LIST
:
759 ret
= ctf_visitor_field_class_specifier_list(depth
, node
, log_cfg
);
763 case NODE_TYPE_SPECIFIER
:
764 ret
= ctf_visitor_field_class_specifier(depth
, node
, log_cfg
);
769 switch (node
->parent
->type
) {
770 case NODE_TYPE_DECLARATOR
:
776 case NODE_TYPE_DECLARATOR
:
777 ret
= ctf_visitor_field_class_declarator(depth
, node
, log_cfg
);
782 case NODE_FLOATING_POINT
:
783 switch (node
->parent
->type
) {
784 case NODE_TYPE_SPECIFIER
:
789 case NODE_UNARY_EXPRESSION
:
792 bt_list_for_each_entry (iter
, &node
->u
.floating_point
.expressions
, siblings
) {
793 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
799 switch (node
->parent
->type
) {
800 case NODE_TYPE_SPECIFIER
:
806 bt_list_for_each_entry (iter
, &node
->u
.integer
.expressions
, siblings
) {
807 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
813 switch (node
->parent
->type
) {
814 case NODE_TYPE_SPECIFIER
:
819 case NODE_UNARY_EXPRESSION
:
823 bt_list_for_each_entry (iter
, &node
->u
.string
.expressions
, siblings
) {
824 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
829 case NODE_ENUMERATOR
:
830 switch (node
->parent
->type
) {
837 * Enumerators are only allows to contain:
838 * numeric unary expression
839 * or num. unary exp. ... num. unary exp
844 bt_list_for_each_entry (iter
, &node
->u
.enumerator
.values
, siblings
) {
847 if (iter
->type
!= NODE_UNARY_EXPRESSION
||
848 (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
&&
849 iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
) ||
850 iter
->u
.unary_expression
.link
!= UNARY_LINK_UNKNOWN
) {
851 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
852 iter
->lineno
, "First unary expression of enumerator is unexpected.");
857 if (iter
->type
!= NODE_UNARY_EXPRESSION
||
858 (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
&&
859 iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
) ||
860 iter
->u
.unary_expression
.link
!= UNARY_DOTDOTDOT
) {
861 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
862 iter
->lineno
, "Second unary expression of enumerator is unexpected.");
872 bt_list_for_each_entry (iter
, &node
->u
.enumerator
.values
, siblings
) {
873 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
879 switch (node
->parent
->type
) {
880 case NODE_TYPE_SPECIFIER
:
885 case NODE_UNARY_EXPRESSION
:
890 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
._enum
.container_field_class
, log_cfg
);
894 bt_list_for_each_entry (iter
, &node
->u
._enum
.enumerator_list
, siblings
) {
895 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
901 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
902 switch (node
->parent
->type
) {
909 ret
= _ctf_visitor_semantic_check(
910 depth
+ 1, node
->u
.struct_or_variant_declaration
.field_class_specifier_list
, log_cfg
);
913 bt_list_for_each_entry (
914 iter
, &node
->u
.struct_or_variant_declaration
.field_class_declarators
, siblings
) {
915 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
921 switch (node
->parent
->type
) {
922 case NODE_TYPE_SPECIFIER
:
927 case NODE_UNARY_EXPRESSION
:
930 bt_list_for_each_entry (iter
, &node
->u
.variant
.declaration_list
, siblings
) {
931 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
938 switch (node
->parent
->type
) {
939 case NODE_TYPE_SPECIFIER
:
944 case NODE_UNARY_EXPRESSION
:
947 bt_list_for_each_entry (iter
, &node
->u
._struct
.declaration_list
, siblings
) {
948 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
956 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
, "Unknown node type: type=%d", node
->type
);
962 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
963 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
964 node_type(node
), node_type(node
->parent
));
965 return -EINVAL
; /* Incoherent structure */
968 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
969 "Semantic error: node-type=%s, parent-node-type=%s",
970 node_type(node
), node_type(node
->parent
));
971 return -EPERM
; /* Structure not allowed */
974 int ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
, struct meta_log_config
*log_cfg
)
979 * First make sure we create the parent links for all children. Let's
980 * take the safe route and recreate them at each validation, just in
981 * case the structure has changed.
983 ret
= ctf_visitor_parent_links(depth
, node
, log_cfg
);
985 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
986 "Cannot create parent links in metadata's AST: "
992 ret
= _ctf_visitor_semantic_check(depth
, node
, log_cfg
);
994 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
995 "Cannot check metadata's AST semantics: "