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 depth
, struct ctf_node
*node
,
33 struct meta_log_config
*log_cfg
)
35 struct ctf_node
*iter
;
36 int is_ctf_exp
= 0, is_ctf_exp_left
= 0;
38 switch (node
->parent
->type
) {
39 case NODE_CTF_EXPRESSION
:
41 bt_list_for_each_entry (iter
, &node
->parent
->u
.ctf_expression
.left
, siblings
) {
45 * We are a left child of a ctf expression.
46 * We are only allowed to be a string.
48 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
49 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
51 "Left child of a CTF expression is only allowed to be a string.");
57 /* Right child of a ctf expression can be any type of unary exp. */
59 case NODE_TYPE_DECLARATOR
:
61 * We are the length of a type declarator.
63 switch (node
->u
.unary_expression
.type
) {
64 case UNARY_UNSIGNED_CONSTANT
:
68 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
70 "Children of field class declarator and `enum` can only be unsigned numeric constants or references to fields (e.g., `a.b.c`).");
77 * We are the size of a struct align attribute.
79 switch (node
->u
.unary_expression
.type
) {
80 case UNARY_UNSIGNED_CONSTANT
:
83 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
85 "Structure alignment attribute can only be an unsigned numeric constant.");
91 /* The enumerator's parent has validated its validity already. */
94 case NODE_UNARY_EXPRESSION
:
96 * We disallow nested unary expressions and "sbrac" unary
99 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
100 "Nested unary expressions not allowed (`()` and `[]`).");
111 case NODE_TYPEALIAS_TARGET
:
112 case NODE_TYPEALIAS_ALIAS
:
114 case NODE_TYPE_SPECIFIER
:
116 case NODE_FLOATING_POINT
:
120 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
126 switch (node
->u
.unary_expression
.link
) {
127 case UNARY_LINK_UNKNOWN
:
128 /* We don't allow empty link except on the first node of the list */
130 _bt_list_first_entry(is_ctf_exp_left
? &node
->parent
->u
.ctf_expression
.left
:
131 &node
->parent
->u
.ctf_expression
.right
,
132 struct ctf_node
, siblings
) != node
) {
133 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
135 "Empty link is not allowed except on first node of unary expression (need to separate nodes with `.` or `->`).");
140 case UNARY_ARROWLINK
:
141 /* We only allow -> and . links between children of ctf_expression. */
142 if (node
->parent
->type
!= NODE_CTF_EXPRESSION
) {
143 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
144 node
->lineno
, "Links `.` and `->` are only allowed as children of CTF expression.");
148 * Only strings can be separated linked by . or ->.
149 * This includes "", '' and non-quoted identifiers.
151 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
152 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
154 "Links `.` and `->` are only allowed to separate strings and identifiers.");
157 /* We don't allow link on the first node of the list */
159 _bt_list_first_entry(is_ctf_exp_left
? &node
->parent
->u
.ctf_expression
.left
:
160 &node
->parent
->u
.ctf_expression
.right
,
161 struct ctf_node
, siblings
) == node
) {
162 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
164 "Links `.` and `->` are not allowed before first node of the unary expression list.");
168 case UNARY_DOTDOTDOT
:
169 /* We only allow ... link between children of enumerator. */
170 if (node
->parent
->type
!= NODE_ENUMERATOR
) {
171 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
172 "Link `...` is only allowed within enumerator.");
175 /* We don't allow link on the first node of the list */
176 if (_bt_list_first_entry(&node
->parent
->u
.enumerator
.values
, struct ctf_node
, siblings
) ==
178 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
180 "Link `...` is not allowed on the first node of the unary expression list.");
185 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
, "Unknown expression link type: type=%d",
186 node
->u
.unary_expression
.link
);
192 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
193 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
194 node_type(node
), node_type(node
->parent
));
195 return -EINVAL
; /* Incoherent structure */
198 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
199 "Semantic error: node-type=%s, parent-node-type=%s",
200 node_type(node
), node_type(node
->parent
));
201 return -EPERM
; /* Structure not allowed */
204 static int ctf_visitor_field_class_specifier_list(int depth
, struct ctf_node
*node
,
205 struct meta_log_config
*log_cfg
)
207 switch (node
->parent
->type
) {
208 case NODE_CTF_EXPRESSION
:
209 case NODE_TYPE_DECLARATOR
:
211 case NODE_TYPEALIAS_TARGET
:
212 case NODE_TYPEALIAS_ALIAS
:
214 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
224 case NODE_UNARY_EXPRESSION
:
226 case NODE_TYPE_SPECIFIER
:
227 case NODE_TYPE_SPECIFIER_LIST
:
229 case NODE_FLOATING_POINT
:
232 case NODE_ENUMERATOR
:
240 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
241 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
242 node_type(node
), node_type(node
->parent
));
243 return -EINVAL
; /* Incoherent structure */
246 static int ctf_visitor_field_class_specifier(int depth
, struct ctf_node
*node
,
247 struct meta_log_config
*log_cfg
)
249 switch (node
->parent
->type
) {
250 case NODE_TYPE_SPECIFIER_LIST
:
253 case NODE_CTF_EXPRESSION
:
254 case NODE_TYPE_DECLARATOR
:
256 case NODE_TYPEALIAS_TARGET
:
257 case NODE_TYPEALIAS_ALIAS
:
259 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
267 case NODE_UNARY_EXPRESSION
:
269 case NODE_TYPE_SPECIFIER
:
271 case NODE_FLOATING_POINT
:
274 case NODE_ENUMERATOR
:
282 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
283 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
284 node_type(node
), node_type(node
->parent
));
285 return -EINVAL
; /* Incoherent structure */
288 static int ctf_visitor_field_class_declarator(int depth
, struct ctf_node
*node
,
289 struct meta_log_config
*log_cfg
)
292 struct ctf_node
*iter
;
296 switch (node
->parent
->type
) {
297 case NODE_TYPE_DECLARATOR
:
299 * A nested field class declarator is not allowed to
302 if (!bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
305 case NODE_TYPEALIAS_TARGET
:
307 case NODE_TYPEALIAS_ALIAS
:
309 * Only accept alias name containing:
311 * - identifier * (any number of pointers)
312 * NOT accepting alias names containing [] (would otherwise
313 * cause semantic clash for later declarations of
314 * arrays/sequences of elements, where elements could be
315 * arrays/sequences themselves (if allowed in field class alias).
316 * NOT accepting alias with identifier. The declarator should
317 * be either empty or contain pointer(s).
319 if (node
->u
.field_class_declarator
.type
== TYPEDEC_NESTED
)
321 bt_list_for_each_entry (iter
,
322 &node
->parent
->u
.field_class_alias_name
.field_class_specifier_list
323 ->u
.field_class_specifier_list
.head
,
325 switch (iter
->u
.field_class_specifier
.type
) {
326 case TYPESPEC_FLOATING_POINT
:
327 case TYPESPEC_INTEGER
:
328 case TYPESPEC_STRING
:
329 case TYPESPEC_STRUCT
:
330 case TYPESPEC_VARIANT
:
332 if (bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
339 if (node
->u
.field_class_declarator
.type
== TYPEDEC_ID
&&
340 node
->u
.field_class_declarator
.u
.id
)
344 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
354 case NODE_CTF_EXPRESSION
:
355 case NODE_UNARY_EXPRESSION
:
357 case NODE_TYPE_SPECIFIER
:
359 case NODE_FLOATING_POINT
:
362 case NODE_ENUMERATOR
:
370 bt_list_for_each_entry (iter
, &node
->u
.field_class_declarator
.pointers
, siblings
) {
371 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
376 switch (node
->u
.field_class_declarator
.type
) {
381 if (node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
) {
382 ret
= _ctf_visitor_semantic_check(
383 depth
+ 1, node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
, log_cfg
);
387 if (!node
->u
.field_class_declarator
.u
.nested
.abstract_array
) {
388 bt_list_for_each_entry (iter
, &node
->u
.field_class_declarator
.u
.nested
.length
,
390 if (iter
->type
!= NODE_UNARY_EXPRESSION
) {
391 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
392 node
->lineno
, "Expecting unary expression as length: node-type=%s",
396 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
401 if (node
->parent
->type
== NODE_TYPEALIAS_TARGET
) {
402 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
404 "Abstract array declarator not permitted as target of field class alias.");
408 if (node
->u
.field_class_declarator
.bitfield_len
) {
409 ret
= _ctf_visitor_semantic_check(depth
+ 1,
410 node
->u
.field_class_declarator
.bitfield_len
, log_cfg
);
416 case TYPEDEC_UNKNOWN
:
418 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
, "Unknown field class declarator: type=%d",
419 node
->u
.field_class_declarator
.type
);
426 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
427 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
428 node_type(node
), node_type(node
->parent
));
429 return -EINVAL
; /* Incoherent structure */
432 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
433 "Semantic error: node-type=%s, parent-node-type=%s",
434 node_type(node
), node_type(node
->parent
));
435 return -EPERM
; /* Structure not allowed */
438 static int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
439 struct meta_log_config
*log_cfg
)
442 struct ctf_node
*iter
;
447 switch (node
->type
) {
449 bt_list_for_each_entry (iter
, &node
->u
.root
.declaration_list
, siblings
) {
450 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
454 bt_list_for_each_entry (iter
, &node
->u
.root
.trace
, siblings
) {
455 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
459 bt_list_for_each_entry (iter
, &node
->u
.root
.stream
, siblings
) {
460 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
464 bt_list_for_each_entry (iter
, &node
->u
.root
.event
, siblings
) {
465 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
472 switch (node
->parent
->type
) {
479 bt_list_for_each_entry (iter
, &node
->u
.event
.declaration_list
, siblings
) {
480 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
486 switch (node
->parent
->type
) {
493 bt_list_for_each_entry (iter
, &node
->u
.stream
.declaration_list
, siblings
) {
494 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
500 switch (node
->parent
->type
) {
507 bt_list_for_each_entry (iter
, &node
->u
.env
.declaration_list
, siblings
) {
508 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
514 switch (node
->parent
->type
) {
521 bt_list_for_each_entry (iter
, &node
->u
.trace
.declaration_list
, siblings
) {
522 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
528 switch (node
->parent
->type
) {
535 bt_list_for_each_entry (iter
, &node
->u
.clock
.declaration_list
, siblings
) {
536 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
542 switch (node
->parent
->type
) {
549 bt_list_for_each_entry (iter
, &node
->u
.callsite
.declaration_list
, siblings
) {
550 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
556 case NODE_CTF_EXPRESSION
:
557 switch (node
->parent
->type
) {
565 case NODE_FLOATING_POINT
:
570 case NODE_CTF_EXPRESSION
:
571 case NODE_UNARY_EXPRESSION
:
573 case NODE_TYPEALIAS_TARGET
:
574 case NODE_TYPEALIAS_ALIAS
:
575 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
577 case NODE_TYPE_SPECIFIER
:
578 case NODE_TYPE_SPECIFIER_LIST
:
580 case NODE_TYPE_DECLARATOR
:
581 case NODE_ENUMERATOR
:
590 bt_list_for_each_entry (iter
, &node
->u
.ctf_expression
.left
, siblings
) {
591 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
595 bt_list_for_each_entry (iter
, &node
->u
.ctf_expression
.right
, siblings
) {
596 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
602 case NODE_UNARY_EXPRESSION
:
603 return ctf_visitor_unary_expression(depth
, node
, log_cfg
);
606 switch (node
->parent
->type
) {
615 case NODE_CTF_EXPRESSION
:
616 case NODE_UNARY_EXPRESSION
:
618 case NODE_TYPEALIAS_TARGET
:
619 case NODE_TYPEALIAS_ALIAS
:
621 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
622 case NODE_TYPE_SPECIFIER
:
623 case NODE_TYPE_SPECIFIER_LIST
:
625 case NODE_TYPE_DECLARATOR
:
626 case NODE_FLOATING_POINT
:
629 case NODE_ENUMERATOR
:
639 ret
= _ctf_visitor_semantic_check(
640 depth
+ 1, node
->u
.field_class_def
.field_class_specifier_list
, log_cfg
);
643 bt_list_for_each_entry (iter
, &node
->u
.field_class_def
.field_class_declarators
, siblings
) {
644 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
650 case NODE_TYPEALIAS_TARGET
:
654 switch (node
->parent
->type
) {
662 ret
= _ctf_visitor_semantic_check(
663 depth
+ 1, node
->u
.field_class_alias_target
.field_class_specifier_list
, log_cfg
);
667 bt_list_for_each_entry (iter
, &node
->u
.field_class_alias_target
.field_class_declarators
,
669 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
674 if (nr_declarators
> 1) {
675 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
677 "Too many declarators in field class alias's name (maximum is 1): count=%d",
684 case NODE_TYPEALIAS_ALIAS
:
688 switch (node
->parent
->type
) {
696 ret
= _ctf_visitor_semantic_check(
697 depth
+ 1, node
->u
.field_class_alias_name
.field_class_specifier_list
, log_cfg
);
701 bt_list_for_each_entry (iter
, &node
->u
.field_class_alias_name
.field_class_declarators
,
703 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
708 if (nr_declarators
> 1) {
709 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
711 "Too many declarators in field class alias's name (maximum is 1): count=%d",
719 switch (node
->parent
->type
) {
728 case NODE_CTF_EXPRESSION
:
729 case NODE_UNARY_EXPRESSION
:
731 case NODE_TYPEALIAS_TARGET
:
732 case NODE_TYPEALIAS_ALIAS
:
734 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
735 case NODE_TYPE_SPECIFIER
:
736 case NODE_TYPE_SPECIFIER_LIST
:
738 case NODE_TYPE_DECLARATOR
:
739 case NODE_FLOATING_POINT
:
742 case NODE_ENUMERATOR
:
751 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
.field_class_alias
.target
, log_cfg
);
754 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
.field_class_alias
.alias
, log_cfg
);
759 case NODE_TYPE_SPECIFIER_LIST
:
760 ret
= ctf_visitor_field_class_specifier_list(depth
, node
, log_cfg
);
764 case NODE_TYPE_SPECIFIER
:
765 ret
= ctf_visitor_field_class_specifier(depth
, node
, log_cfg
);
770 switch (node
->parent
->type
) {
771 case NODE_TYPE_DECLARATOR
:
777 case NODE_TYPE_DECLARATOR
:
778 ret
= ctf_visitor_field_class_declarator(depth
, node
, log_cfg
);
783 case NODE_FLOATING_POINT
:
784 switch (node
->parent
->type
) {
785 case NODE_TYPE_SPECIFIER
:
790 case NODE_UNARY_EXPRESSION
:
793 bt_list_for_each_entry (iter
, &node
->u
.floating_point
.expressions
, siblings
) {
794 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
800 switch (node
->parent
->type
) {
801 case NODE_TYPE_SPECIFIER
:
807 bt_list_for_each_entry (iter
, &node
->u
.integer
.expressions
, siblings
) {
808 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
814 switch (node
->parent
->type
) {
815 case NODE_TYPE_SPECIFIER
:
820 case NODE_UNARY_EXPRESSION
:
824 bt_list_for_each_entry (iter
, &node
->u
.string
.expressions
, siblings
) {
825 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
830 case NODE_ENUMERATOR
:
831 switch (node
->parent
->type
) {
838 * Enumerators are only allows to contain:
839 * numeric unary expression
840 * or num. unary exp. ... num. unary exp
845 bt_list_for_each_entry (iter
, &node
->u
.enumerator
.values
, siblings
) {
848 if (iter
->type
!= NODE_UNARY_EXPRESSION
||
849 (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
&&
850 iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
) ||
851 iter
->u
.unary_expression
.link
!= UNARY_LINK_UNKNOWN
) {
852 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
853 iter
->lineno
, "First unary expression of enumerator is unexpected.");
858 if (iter
->type
!= NODE_UNARY_EXPRESSION
||
859 (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
&&
860 iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
) ||
861 iter
->u
.unary_expression
.link
!= UNARY_DOTDOTDOT
) {
862 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
863 iter
->lineno
, "Second unary expression of enumerator is unexpected.");
873 bt_list_for_each_entry (iter
, &node
->u
.enumerator
.values
, siblings
) {
874 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
880 switch (node
->parent
->type
) {
881 case NODE_TYPE_SPECIFIER
:
886 case NODE_UNARY_EXPRESSION
:
891 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
._enum
.container_field_class
, log_cfg
);
895 bt_list_for_each_entry (iter
, &node
->u
._enum
.enumerator_list
, siblings
) {
896 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
902 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
903 switch (node
->parent
->type
) {
910 ret
= _ctf_visitor_semantic_check(
911 depth
+ 1, node
->u
.struct_or_variant_declaration
.field_class_specifier_list
, log_cfg
);
914 bt_list_for_each_entry (
915 iter
, &node
->u
.struct_or_variant_declaration
.field_class_declarators
, siblings
) {
916 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
922 switch (node
->parent
->type
) {
923 case NODE_TYPE_SPECIFIER
:
928 case NODE_UNARY_EXPRESSION
:
931 bt_list_for_each_entry (iter
, &node
->u
.variant
.declaration_list
, siblings
) {
932 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
939 switch (node
->parent
->type
) {
940 case NODE_TYPE_SPECIFIER
:
945 case NODE_UNARY_EXPRESSION
:
948 bt_list_for_each_entry (iter
, &node
->u
._struct
.declaration_list
, siblings
) {
949 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
957 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
, "Unknown node type: type=%d", node
->type
);
963 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(
964 node
->lineno
, "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
965 node_type(node
), node_type(node
->parent
));
966 return -EINVAL
; /* Incoherent structure */
969 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
970 "Semantic error: node-type=%s, parent-node-type=%s",
971 node_type(node
), node_type(node
->parent
));
972 return -EPERM
; /* Structure not allowed */
975 int ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
, struct meta_log_config
*log_cfg
)
980 * First make sure we create the parent links for all children. Let's
981 * take the safe route and recreate them at each validation, just in
982 * case the structure has changed.
984 ret
= ctf_visitor_parent_links(depth
, node
, log_cfg
);
986 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
987 "Cannot create parent links in metadata's AST: "
993 ret
= _ctf_visitor_semantic_check(depth
, node
, log_cfg
);
995 _BT_COMP_LOGE_APPEND_CAUSE_LINENO(node
->lineno
,
996 "Cannot check metadata's AST semantics: "