2 * SPDX-License-Identifier: MIT
4 * Copyright 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * Common Trace Format Metadata Semantic Validator.
17 #define BT_COMP_LOG_SELF_COMP (log_cfg->self_comp)
18 #define BT_LOG_OUTPUT_LEVEL (log_cfg->log_level)
19 #define BT_LOG_TAG "PLUGIN/CTF/META/SEMANTIC-VALIDATOR-VISITOR"
20 #include "logging.hpp"
21 #include "logging/comp-logging.h"
23 #include "common/assert.h"
24 #include "common/list.h"
27 #include "scanner.hpp"
29 #define _bt_list_first_entry(ptr, type, member) bt_list_entry((ptr)->next, type, member)
31 static int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
32 struct meta_log_config
*log_cfg
);
34 static int ctf_visitor_unary_expression(int, struct ctf_node
*node
, struct meta_log_config
*log_cfg
)
36 struct ctf_node
*iter
;
37 int is_ctf_exp
= 0, is_ctf_exp_left
= 0;
39 switch (node
->parent
->type
) {
40 case NODE_CTF_EXPRESSION
:
42 bt_list_for_each_entry (iter
, &node
->parent
->u
.ctf_expression
.left
, siblings
) {
46 * We are a left child of a ctf expression.
47 * We are only allowed to be a string.
49 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
50 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
52 "Left child of a CTF expression is only allowed to be a string.");
58 /* Right child of a ctf expression can be any type of unary exp. */
60 case NODE_TYPE_DECLARATOR
:
62 * We are the length of a type declarator.
64 switch (node
->u
.unary_expression
.type
) {
65 case UNARY_UNSIGNED_CONSTANT
:
69 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
71 "Children of field class declarator and `enum` can only be unsigned numeric constants or references to fields (e.g., `a.b.c`).");
78 * We are the size of a struct align attribute.
80 switch (node
->u
.unary_expression
.type
) {
81 case UNARY_UNSIGNED_CONSTANT
:
84 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
86 "Structure alignment attribute can only be an unsigned numeric constant.");
92 /* The enumerator's parent has validated its validity already. */
95 case NODE_UNARY_EXPRESSION
:
97 * We disallow nested unary expressions and "sbrac" unary
100 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
101 "Nested unary expressions not allowed (`()` and `[]`).");
112 case NODE_TYPEALIAS_TARGET
:
113 case NODE_TYPEALIAS_ALIAS
:
115 case NODE_TYPE_SPECIFIER
:
117 case NODE_FLOATING_POINT
:
121 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
127 switch (node
->u
.unary_expression
.link
) {
128 case UNARY_LINK_UNKNOWN
:
129 /* We don't allow empty link except on the first node of the list */
131 _bt_list_first_entry(is_ctf_exp_left
? &node
->parent
->u
.ctf_expression
.left
:
132 &node
->parent
->u
.ctf_expression
.right
,
133 struct ctf_node
, siblings
) != node
) {
134 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
136 "Empty link is not allowed except on first node of unary expression (need to separate nodes with `.` or `->`).");
141 case UNARY_ARROWLINK
:
142 /* We only allow -> and . links between children of ctf_expression. */
143 if (node
->parent
->type
!= NODE_CTF_EXPRESSION
) {
144 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
145 node
->lineno
, "Links `.` and `->` are only allowed as children of CTF expression.");
149 * Only strings can be separated linked by . or ->.
150 * This includes "", '' and non-quoted identifiers.
152 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
153 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
155 "Links `.` and `->` are only allowed to separate strings and identifiers.");
158 /* We don't allow link on the first node of the list */
160 _bt_list_first_entry(is_ctf_exp_left
? &node
->parent
->u
.ctf_expression
.left
:
161 &node
->parent
->u
.ctf_expression
.right
,
162 struct ctf_node
, siblings
) == node
) {
163 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
165 "Links `.` and `->` are not allowed before first node of the unary expression list.");
169 case UNARY_DOTDOTDOT
:
170 /* We only allow ... link between children of enumerator. */
171 if (node
->parent
->type
!= NODE_ENUMERATOR
) {
172 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
173 "Link `...` is only allowed within enumerator.");
176 /* We don't allow link on the first node of the list */
177 if (_bt_list_first_entry(&node
->parent
->u
.enumerator
.values
, struct ctf_node
, siblings
) ==
179 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
181 "Link `...` is not allowed on the first node of the unary expression list.");
186 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
, "Unknown expression link type: type=%d",
187 node
->u
.unary_expression
.link
);
193 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
194 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
195 node_type(node
), node_type(node
->parent
));
196 return -EINVAL
; /* Incoherent structure */
199 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
200 "Semantic error: node-type=%s, parent-node-type=%s",
201 node_type(node
), node_type(node
->parent
));
202 return -EPERM
; /* Structure not allowed */
205 static int ctf_visitor_field_class_specifier_list(int, struct ctf_node
*node
,
206 struct meta_log_config
*log_cfg
)
208 switch (node
->parent
->type
) {
209 case NODE_CTF_EXPRESSION
:
210 case NODE_TYPE_DECLARATOR
:
212 case NODE_TYPEALIAS_TARGET
:
213 case NODE_TYPEALIAS_ALIAS
:
215 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
225 case NODE_UNARY_EXPRESSION
:
227 case NODE_TYPE_SPECIFIER
:
228 case NODE_TYPE_SPECIFIER_LIST
:
230 case NODE_FLOATING_POINT
:
233 case NODE_ENUMERATOR
:
241 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
242 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
243 node_type(node
), node_type(node
->parent
));
244 return -EINVAL
; /* Incoherent structure */
247 static int ctf_visitor_field_class_specifier(int, struct ctf_node
*node
,
248 struct meta_log_config
*log_cfg
)
250 switch (node
->parent
->type
) {
251 case NODE_TYPE_SPECIFIER_LIST
:
254 case NODE_CTF_EXPRESSION
:
255 case NODE_TYPE_DECLARATOR
:
257 case NODE_TYPEALIAS_TARGET
:
258 case NODE_TYPEALIAS_ALIAS
:
260 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
268 case NODE_UNARY_EXPRESSION
:
270 case NODE_TYPE_SPECIFIER
:
272 case NODE_FLOATING_POINT
:
275 case NODE_ENUMERATOR
:
283 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
284 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
285 node_type(node
), node_type(node
->parent
));
286 return -EINVAL
; /* Incoherent structure */
289 static int ctf_visitor_field_class_declarator(int depth
, struct ctf_node
*node
,
290 struct meta_log_config
*log_cfg
)
293 struct ctf_node
*iter
;
297 switch (node
->parent
->type
) {
298 case NODE_TYPE_DECLARATOR
:
300 * A nested field class declarator is not allowed to
303 if (!bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
306 case NODE_TYPEALIAS_TARGET
:
308 case NODE_TYPEALIAS_ALIAS
:
310 * Only accept alias name containing:
312 * - identifier * (any number of pointers)
313 * NOT accepting alias names containing [] (would otherwise
314 * cause semantic clash for later declarations of
315 * arrays/sequences of elements, where elements could be
316 * arrays/sequences themselves (if allowed in field class alias).
317 * NOT accepting alias with identifier. The declarator should
318 * be either empty or contain pointer(s).
320 if (node
->u
.field_class_declarator
.type
== TYPEDEC_NESTED
)
322 bt_list_for_each_entry (iter
,
323 &node
->parent
->u
.field_class_alias_name
.field_class_specifier_list
324 ->u
.field_class_specifier_list
.head
,
326 switch (iter
->u
.field_class_specifier
.type
) {
327 case TYPESPEC_FLOATING_POINT
:
328 case TYPESPEC_INTEGER
:
329 case TYPESPEC_STRING
:
330 case TYPESPEC_STRUCT
:
331 case TYPESPEC_VARIANT
:
333 if (bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
340 if (node
->u
.field_class_declarator
.type
== TYPEDEC_ID
&&
341 node
->u
.field_class_declarator
.u
.id
)
345 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
355 case NODE_CTF_EXPRESSION
:
356 case NODE_UNARY_EXPRESSION
:
358 case NODE_TYPE_SPECIFIER
:
360 case NODE_FLOATING_POINT
:
363 case NODE_ENUMERATOR
:
371 bt_list_for_each_entry (iter
, &node
->u
.field_class_declarator
.pointers
, siblings
) {
372 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
377 switch (node
->u
.field_class_declarator
.type
) {
382 if (node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
) {
383 ret
= _ctf_visitor_semantic_check(
384 depth
+ 1, node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
, log_cfg
);
388 if (!node
->u
.field_class_declarator
.u
.nested
.abstract_array
) {
389 bt_list_for_each_entry (iter
, &node
->u
.field_class_declarator
.u
.nested
.length
,
391 if (iter
->type
!= NODE_UNARY_EXPRESSION
) {
392 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
393 node
->lineno
, "Expecting unary expression as length: node-type=%s",
397 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
402 if (node
->parent
->type
== NODE_TYPEALIAS_TARGET
) {
403 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
405 "Abstract array declarator not permitted as target of field class alias.");
409 if (node
->u
.field_class_declarator
.bitfield_len
) {
410 ret
= _ctf_visitor_semantic_check(depth
+ 1,
411 node
->u
.field_class_declarator
.bitfield_len
, log_cfg
);
417 case TYPEDEC_UNKNOWN
:
419 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
, "Unknown field class declarator: type=%d",
420 node
->u
.field_class_declarator
.type
);
427 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
428 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
429 node_type(node
), node_type(node
->parent
));
430 return -EINVAL
; /* Incoherent structure */
433 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
434 "Semantic error: node-type=%s, parent-node-type=%s",
435 node_type(node
), node_type(node
->parent
));
436 return -EPERM
; /* Structure not allowed */
439 static int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
440 struct meta_log_config
*log_cfg
)
443 struct ctf_node
*iter
;
448 switch (node
->type
) {
450 bt_list_for_each_entry (iter
, &node
->u
.root
.declaration_list
, siblings
) {
451 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
455 bt_list_for_each_entry (iter
, &node
->u
.root
.trace
, siblings
) {
456 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
460 bt_list_for_each_entry (iter
, &node
->u
.root
.stream
, siblings
) {
461 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
465 bt_list_for_each_entry (iter
, &node
->u
.root
.event
, siblings
) {
466 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
473 switch (node
->parent
->type
) {
480 bt_list_for_each_entry (iter
, &node
->u
.event
.declaration_list
, siblings
) {
481 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
487 switch (node
->parent
->type
) {
494 bt_list_for_each_entry (iter
, &node
->u
.stream
.declaration_list
, siblings
) {
495 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
501 switch (node
->parent
->type
) {
508 bt_list_for_each_entry (iter
, &node
->u
.env
.declaration_list
, siblings
) {
509 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
515 switch (node
->parent
->type
) {
522 bt_list_for_each_entry (iter
, &node
->u
.trace
.declaration_list
, siblings
) {
523 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
529 switch (node
->parent
->type
) {
536 bt_list_for_each_entry (iter
, &node
->u
.clock
.declaration_list
, siblings
) {
537 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
543 switch (node
->parent
->type
) {
550 bt_list_for_each_entry (iter
, &node
->u
.callsite
.declaration_list
, siblings
) {
551 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
557 case NODE_CTF_EXPRESSION
:
558 switch (node
->parent
->type
) {
566 case NODE_FLOATING_POINT
:
571 case NODE_CTF_EXPRESSION
:
572 case NODE_UNARY_EXPRESSION
:
574 case NODE_TYPEALIAS_TARGET
:
575 case NODE_TYPEALIAS_ALIAS
:
576 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
578 case NODE_TYPE_SPECIFIER
:
579 case NODE_TYPE_SPECIFIER_LIST
:
581 case NODE_TYPE_DECLARATOR
:
582 case NODE_ENUMERATOR
:
591 bt_list_for_each_entry (iter
, &node
->u
.ctf_expression
.left
, siblings
) {
592 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
596 bt_list_for_each_entry (iter
, &node
->u
.ctf_expression
.right
, siblings
) {
597 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
603 case NODE_UNARY_EXPRESSION
:
604 return ctf_visitor_unary_expression(depth
, node
, log_cfg
);
607 switch (node
->parent
->type
) {
616 case NODE_CTF_EXPRESSION
:
617 case NODE_UNARY_EXPRESSION
:
619 case NODE_TYPEALIAS_TARGET
:
620 case NODE_TYPEALIAS_ALIAS
:
622 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
623 case NODE_TYPE_SPECIFIER
:
624 case NODE_TYPE_SPECIFIER_LIST
:
626 case NODE_TYPE_DECLARATOR
:
627 case NODE_FLOATING_POINT
:
630 case NODE_ENUMERATOR
:
640 ret
= _ctf_visitor_semantic_check(
641 depth
+ 1, node
->u
.field_class_def
.field_class_specifier_list
, log_cfg
);
644 bt_list_for_each_entry (iter
, &node
->u
.field_class_def
.field_class_declarators
, siblings
) {
645 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
651 case NODE_TYPEALIAS_TARGET
:
655 switch (node
->parent
->type
) {
663 ret
= _ctf_visitor_semantic_check(
664 depth
+ 1, node
->u
.field_class_alias_target
.field_class_specifier_list
, log_cfg
);
668 bt_list_for_each_entry (iter
, &node
->u
.field_class_alias_target
.field_class_declarators
,
670 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
675 if (nr_declarators
> 1) {
676 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
678 "Too many declarators in field class alias's name (maximum is 1): count=%d",
685 case NODE_TYPEALIAS_ALIAS
:
689 switch (node
->parent
->type
) {
697 ret
= _ctf_visitor_semantic_check(
698 depth
+ 1, node
->u
.field_class_alias_name
.field_class_specifier_list
, log_cfg
);
702 bt_list_for_each_entry (iter
, &node
->u
.field_class_alias_name
.field_class_declarators
,
704 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
709 if (nr_declarators
> 1) {
710 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
712 "Too many declarators in field class alias's name (maximum is 1): count=%d",
720 switch (node
->parent
->type
) {
729 case NODE_CTF_EXPRESSION
:
730 case NODE_UNARY_EXPRESSION
:
732 case NODE_TYPEALIAS_TARGET
:
733 case NODE_TYPEALIAS_ALIAS
:
735 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
736 case NODE_TYPE_SPECIFIER
:
737 case NODE_TYPE_SPECIFIER_LIST
:
739 case NODE_TYPE_DECLARATOR
:
740 case NODE_FLOATING_POINT
:
743 case NODE_ENUMERATOR
:
752 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
.field_class_alias
.target
, log_cfg
);
755 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
.field_class_alias
.alias
, log_cfg
);
760 case NODE_TYPE_SPECIFIER_LIST
:
761 ret
= ctf_visitor_field_class_specifier_list(depth
, node
, log_cfg
);
765 case NODE_TYPE_SPECIFIER
:
766 ret
= ctf_visitor_field_class_specifier(depth
, node
, log_cfg
);
771 switch (node
->parent
->type
) {
772 case NODE_TYPE_DECLARATOR
:
778 case NODE_TYPE_DECLARATOR
:
779 ret
= ctf_visitor_field_class_declarator(depth
, node
, log_cfg
);
784 case NODE_FLOATING_POINT
:
785 switch (node
->parent
->type
) {
786 case NODE_TYPE_SPECIFIER
:
791 case NODE_UNARY_EXPRESSION
:
794 bt_list_for_each_entry (iter
, &node
->u
.floating_point
.expressions
, siblings
) {
795 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
801 switch (node
->parent
->type
) {
802 case NODE_TYPE_SPECIFIER
:
808 bt_list_for_each_entry (iter
, &node
->u
.integer
.expressions
, siblings
) {
809 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
815 switch (node
->parent
->type
) {
816 case NODE_TYPE_SPECIFIER
:
821 case NODE_UNARY_EXPRESSION
:
825 bt_list_for_each_entry (iter
, &node
->u
.string
.expressions
, siblings
) {
826 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
831 case NODE_ENUMERATOR
:
832 switch (node
->parent
->type
) {
839 * Enumerators are only allows to contain:
840 * numeric unary expression
841 * or num. unary exp. ... num. unary exp
846 bt_list_for_each_entry (iter
, &node
->u
.enumerator
.values
, siblings
) {
849 if (iter
->type
!= NODE_UNARY_EXPRESSION
||
850 (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
&&
851 iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
) ||
852 iter
->u
.unary_expression
.link
!= UNARY_LINK_UNKNOWN
) {
853 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
854 iter
->lineno
, "First unary expression of enumerator is unexpected.");
859 if (iter
->type
!= NODE_UNARY_EXPRESSION
||
860 (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
&&
861 iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
) ||
862 iter
->u
.unary_expression
.link
!= UNARY_DOTDOTDOT
) {
863 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
864 iter
->lineno
, "Second unary expression of enumerator is unexpected.");
874 bt_list_for_each_entry (iter
, &node
->u
.enumerator
.values
, siblings
) {
875 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
881 switch (node
->parent
->type
) {
882 case NODE_TYPE_SPECIFIER
:
887 case NODE_UNARY_EXPRESSION
:
892 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
._enum
.container_field_class
, log_cfg
);
896 bt_list_for_each_entry (iter
, &node
->u
._enum
.enumerator_list
, siblings
) {
897 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
903 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
904 switch (node
->parent
->type
) {
911 ret
= _ctf_visitor_semantic_check(
912 depth
+ 1, node
->u
.struct_or_variant_declaration
.field_class_specifier_list
, log_cfg
);
915 bt_list_for_each_entry (
916 iter
, &node
->u
.struct_or_variant_declaration
.field_class_declarators
, siblings
) {
917 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
923 switch (node
->parent
->type
) {
924 case NODE_TYPE_SPECIFIER
:
929 case NODE_UNARY_EXPRESSION
:
932 bt_list_for_each_entry (iter
, &node
->u
.variant
.declaration_list
, siblings
) {
933 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
940 switch (node
->parent
->type
) {
941 case NODE_TYPE_SPECIFIER
:
946 case NODE_UNARY_EXPRESSION
:
949 bt_list_for_each_entry (iter
, &node
->u
._struct
.declaration_list
, siblings
) {
950 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
958 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
, "Unknown node type: type=%d", node
->type
);
964 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
965 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
966 node_type(node
), node_type(node
->parent
));
967 return -EINVAL
; /* Incoherent structure */
970 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
971 "Semantic error: node-type=%s, parent-node-type=%s",
972 node_type(node
), node_type(node
->parent
));
973 return -EPERM
; /* Structure not allowed */
976 int ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
, struct meta_log_config
*log_cfg
)
981 * First make sure we create the parent links for all children. Let's
982 * take the safe route and recreate them at each validation, just in
983 * case the structure has changed.
985 ret
= ctf_visitor_parent_links(depth
, node
, log_cfg
);
987 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
988 "Cannot create parent links in metadata's AST: "
994 ret
= _ctf_visitor_semantic_check(depth
, node
, log_cfg
);
996 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
997 "Cannot check metadata's AST semantics: "