2 * ctf-visitor-semantic-validator.c
4 * Common Trace Format Metadata Semantic Validator.
6 * Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 #define BT_COMP_LOG_SELF_COMP (log_cfg->self_comp)
28 #define BT_LOG_OUTPUT_LEVEL (log_cfg->log_level)
29 #define BT_LOG_TAG "PLUGIN/CTF/META/SEMANTIC-VALIDATOR-VISITOR"
30 #include "logging/comp-logging.h"
36 #include "common/assert.h"
40 #include "common/list.h"
46 #define _bt_list_first_entry(ptr, type, member) \
47 bt_list_entry((ptr)->next, type, member)
50 int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
51 struct meta_log_config
*log_cfg
);
54 int ctf_visitor_unary_expression(int depth
, struct ctf_node
*node
,
55 struct meta_log_config
*log_cfg
)
57 struct ctf_node
*iter
;
58 int is_ctf_exp
= 0, is_ctf_exp_left
= 0;
60 switch (node
->parent
->type
) {
61 case NODE_CTF_EXPRESSION
:
63 bt_list_for_each_entry(iter
, &node
->parent
->u
.ctf_expression
.left
,
68 * We are a left child of a ctf expression.
69 * We are only allowed to be a string.
71 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
72 _BT_COMP_LOGE_LINENO(node
->lineno
,
73 "Left child of a CTF expression is only allowed to be a string.");
79 /* Right child of a ctf expression can be any type of unary exp. */
81 case NODE_TYPE_DECLARATOR
:
83 * We are the length of a type declarator.
85 switch (node
->u
.unary_expression
.type
) {
86 case UNARY_UNSIGNED_CONSTANT
:
90 _BT_COMP_LOGE_LINENO(node
->lineno
,
91 "Children of field class declarator and `enum` can only be unsigned numeric constants or references to fields (e.g., `a.b.c`).");
98 * We are the size of a struct align attribute.
100 switch (node
->u
.unary_expression
.type
) {
101 case UNARY_UNSIGNED_CONSTANT
:
104 _BT_COMP_LOGE_LINENO(node
->lineno
,
105 "Structure alignment attribute can only be an unsigned numeric constant.");
110 case NODE_ENUMERATOR
:
111 /* The enumerator's parent has validated its validity already. */
114 case NODE_UNARY_EXPRESSION
:
116 * We disallow nested unary expressions and "sbrac" unary
119 _BT_COMP_LOGE_LINENO(node
->lineno
,
120 "Nested unary expressions not allowed (`()` and `[]`).");
131 case NODE_TYPEALIAS_TARGET
:
132 case NODE_TYPEALIAS_ALIAS
:
134 case NODE_TYPE_SPECIFIER
:
136 case NODE_FLOATING_POINT
:
140 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
146 switch (node
->u
.unary_expression
.link
) {
147 case UNARY_LINK_UNKNOWN
:
148 /* We don't allow empty link except on the first node of the list */
149 if (is_ctf_exp
&& _bt_list_first_entry(is_ctf_exp_left
?
150 &node
->parent
->u
.ctf_expression
.left
:
151 &node
->parent
->u
.ctf_expression
.right
,
154 _BT_COMP_LOGE_LINENO(node
->lineno
,
155 "Empty link is not allowed except on first node of unary expression (need to separate nodes with `.` or `->`).");
160 case UNARY_ARROWLINK
:
161 /* We only allow -> and . links between children of ctf_expression. */
162 if (node
->parent
->type
!= NODE_CTF_EXPRESSION
) {
163 _BT_COMP_LOGE_LINENO(node
->lineno
,
164 "Links `.` and `->` are only allowed as children of CTF expression.");
168 * Only strings can be separated linked by . or ->.
169 * This includes "", '' and non-quoted identifiers.
171 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
172 _BT_COMP_LOGE_LINENO(node
->lineno
,
173 "Links `.` and `->` are only allowed to separate strings and identifiers.");
176 /* We don't allow link on the first node of the list */
177 if (is_ctf_exp
&& _bt_list_first_entry(is_ctf_exp_left
?
178 &node
->parent
->u
.ctf_expression
.left
:
179 &node
->parent
->u
.ctf_expression
.right
,
182 _BT_COMP_LOGE_LINENO(node
->lineno
,
183 "Links `.` and `->` are not allowed before first node of the unary expression list.");
187 case UNARY_DOTDOTDOT
:
188 /* We only allow ... link between children of enumerator. */
189 if (node
->parent
->type
!= NODE_ENUMERATOR
) {
190 _BT_COMP_LOGE_LINENO(node
->lineno
,
191 "Link `...` is only allowed within enumerator.");
194 /* We don't allow link on the first node of the list */
195 if (_bt_list_first_entry(&node
->parent
->u
.enumerator
.values
,
198 _BT_COMP_LOGE_LINENO(node
->lineno
,
199 "Link `...` is not allowed on the first node of the unary expression list.");
204 _BT_COMP_LOGE_LINENO(node
->lineno
,
205 "Unknown expression link type: type=%d",
206 node
->u
.unary_expression
.link
);
212 _BT_COMP_LOGE_LINENO(node
->lineno
,
213 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
214 node_type(node
), node_type(node
->parent
));
215 return -EINVAL
; /* Incoherent structure */
218 _BT_COMP_LOGE_LINENO(node
->lineno
,
219 "Semantic error: node-type=%s, parent-node-type=%s",
220 node_type(node
), node_type(node
->parent
));
221 return -EPERM
; /* Structure not allowed */
225 int ctf_visitor_field_class_specifier_list(int depth
, struct ctf_node
*node
,
226 struct meta_log_config
*log_cfg
)
228 switch (node
->parent
->type
) {
229 case NODE_CTF_EXPRESSION
:
230 case NODE_TYPE_DECLARATOR
:
232 case NODE_TYPEALIAS_TARGET
:
233 case NODE_TYPEALIAS_ALIAS
:
235 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
245 case NODE_UNARY_EXPRESSION
:
247 case NODE_TYPE_SPECIFIER
:
248 case NODE_TYPE_SPECIFIER_LIST
:
250 case NODE_FLOATING_POINT
:
253 case NODE_ENUMERATOR
:
261 _BT_COMP_LOGE_LINENO(node
->lineno
,
262 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
263 node_type(node
), node_type(node
->parent
));
264 return -EINVAL
; /* Incoherent structure */
268 int ctf_visitor_field_class_specifier(int depth
, struct ctf_node
*node
,
269 struct meta_log_config
*log_cfg
)
271 switch (node
->parent
->type
) {
272 case NODE_TYPE_SPECIFIER_LIST
:
275 case NODE_CTF_EXPRESSION
:
276 case NODE_TYPE_DECLARATOR
:
278 case NODE_TYPEALIAS_TARGET
:
279 case NODE_TYPEALIAS_ALIAS
:
281 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
289 case NODE_UNARY_EXPRESSION
:
291 case NODE_TYPE_SPECIFIER
:
293 case NODE_FLOATING_POINT
:
296 case NODE_ENUMERATOR
:
304 _BT_COMP_LOGE_LINENO(node
->lineno
,
305 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
306 node_type(node
), node_type(node
->parent
));
307 return -EINVAL
; /* Incoherent structure */
311 int ctf_visitor_field_class_declarator(int depth
, struct ctf_node
*node
,
312 struct meta_log_config
*log_cfg
)
315 struct ctf_node
*iter
;
319 switch (node
->parent
->type
) {
320 case NODE_TYPE_DECLARATOR
:
322 * A nested field class declarator is not allowed to
325 if (!bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
328 case NODE_TYPEALIAS_TARGET
:
330 case NODE_TYPEALIAS_ALIAS
:
332 * Only accept alias name containing:
334 * - identifier * (any number of pointers)
335 * NOT accepting alias names containing [] (would otherwise
336 * cause semantic clash for later declarations of
337 * arrays/sequences of elements, where elements could be
338 * arrays/sequences themselves (if allowed in field class alias).
339 * NOT accepting alias with identifier. The declarator should
340 * be either empty or contain pointer(s).
342 if (node
->u
.field_class_declarator
.type
== TYPEDEC_NESTED
)
344 bt_list_for_each_entry(iter
, &node
->parent
->u
.field_class_alias_name
.field_class_specifier_list
->u
.field_class_specifier_list
.head
,
346 switch (iter
->u
.field_class_specifier
.type
) {
347 case TYPESPEC_FLOATING_POINT
:
348 case TYPESPEC_INTEGER
:
349 case TYPESPEC_STRING
:
350 case TYPESPEC_STRUCT
:
351 case TYPESPEC_VARIANT
:
353 if (bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
360 if (node
->u
.field_class_declarator
.type
== TYPEDEC_ID
&&
361 node
->u
.field_class_declarator
.u
.id
)
365 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
375 case NODE_CTF_EXPRESSION
:
376 case NODE_UNARY_EXPRESSION
:
378 case NODE_TYPE_SPECIFIER
:
380 case NODE_FLOATING_POINT
:
383 case NODE_ENUMERATOR
:
391 bt_list_for_each_entry(iter
, &node
->u
.field_class_declarator
.pointers
,
393 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, log_cfg
);
398 switch (node
->u
.field_class_declarator
.type
) {
403 if (node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
) {
404 ret
= _ctf_visitor_semantic_check(depth
+ 1,
405 node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
,
410 if (!node
->u
.field_class_declarator
.u
.nested
.abstract_array
) {
411 bt_list_for_each_entry(iter
, &node
->u
.field_class_declarator
.u
.nested
.length
,
413 if (iter
->type
!= NODE_UNARY_EXPRESSION
) {
414 _BT_COMP_LOGE_LINENO(node
->lineno
,
415 "Expecting unary expression as length: node-type=%s",
419 ret
= _ctf_visitor_semantic_check(depth
+ 1,
425 if (node
->parent
->type
== NODE_TYPEALIAS_TARGET
) {
426 _BT_COMP_LOGE_LINENO(node
->lineno
,
427 "Abstract array declarator not permitted as target of field class alias.");
431 if (node
->u
.field_class_declarator
.bitfield_len
) {
432 ret
= _ctf_visitor_semantic_check(depth
+ 1,
433 node
->u
.field_class_declarator
.bitfield_len
,
440 case TYPEDEC_UNKNOWN
:
442 _BT_COMP_LOGE_LINENO(node
->lineno
,
443 "Unknown field class declarator: type=%d",
444 node
->u
.field_class_declarator
.type
);
451 _BT_COMP_LOGE_LINENO(node
->lineno
,
452 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
453 node_type(node
), node_type(node
->parent
));
454 return -EINVAL
; /* Incoherent structure */
457 _BT_COMP_LOGE_LINENO(node
->lineno
,
458 "Semantic error: node-type=%s, parent-node-type=%s",
459 node_type(node
), node_type(node
->parent
));
460 return -EPERM
; /* Structure not allowed */
464 int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
465 struct meta_log_config
*log_cfg
)
468 struct ctf_node
*iter
;
473 switch (node
->type
) {
475 bt_list_for_each_entry(iter
, &node
->u
.root
.declaration_list
, siblings
) {
476 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
481 bt_list_for_each_entry(iter
, &node
->u
.root
.trace
, siblings
) {
482 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
487 bt_list_for_each_entry(iter
, &node
->u
.root
.stream
, siblings
) {
488 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
493 bt_list_for_each_entry(iter
, &node
->u
.root
.event
, siblings
) {
494 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
502 switch (node
->parent
->type
) {
509 bt_list_for_each_entry(iter
, &node
->u
.event
.declaration_list
, siblings
) {
510 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
517 switch (node
->parent
->type
) {
524 bt_list_for_each_entry(iter
, &node
->u
.stream
.declaration_list
, siblings
) {
525 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
532 switch (node
->parent
->type
) {
539 bt_list_for_each_entry(iter
, &node
->u
.env
.declaration_list
, siblings
) {
540 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
547 switch (node
->parent
->type
) {
554 bt_list_for_each_entry(iter
, &node
->u
.trace
.declaration_list
, siblings
) {
555 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
562 switch (node
->parent
->type
) {
569 bt_list_for_each_entry(iter
, &node
->u
.clock
.declaration_list
, siblings
) {
570 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
577 switch (node
->parent
->type
) {
584 bt_list_for_each_entry(iter
, &node
->u
.callsite
.declaration_list
, siblings
) {
585 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
592 case NODE_CTF_EXPRESSION
:
593 switch (node
->parent
->type
) {
601 case NODE_FLOATING_POINT
:
606 case NODE_CTF_EXPRESSION
:
607 case NODE_UNARY_EXPRESSION
:
609 case NODE_TYPEALIAS_TARGET
:
610 case NODE_TYPEALIAS_ALIAS
:
611 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
613 case NODE_TYPE_SPECIFIER
:
614 case NODE_TYPE_SPECIFIER_LIST
:
616 case NODE_TYPE_DECLARATOR
:
617 case NODE_ENUMERATOR
:
626 bt_list_for_each_entry(iter
, &node
->u
.ctf_expression
.left
, siblings
) {
627 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
632 bt_list_for_each_entry(iter
, &node
->u
.ctf_expression
.right
, siblings
) {
633 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
640 case NODE_UNARY_EXPRESSION
:
641 return ctf_visitor_unary_expression(depth
, node
, log_cfg
);
644 switch (node
->parent
->type
) {
653 case NODE_CTF_EXPRESSION
:
654 case NODE_UNARY_EXPRESSION
:
656 case NODE_TYPEALIAS_TARGET
:
657 case NODE_TYPEALIAS_ALIAS
:
659 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
660 case NODE_TYPE_SPECIFIER
:
661 case NODE_TYPE_SPECIFIER_LIST
:
663 case NODE_TYPE_DECLARATOR
:
664 case NODE_FLOATING_POINT
:
667 case NODE_ENUMERATOR
:
677 ret
= _ctf_visitor_semantic_check(depth
+ 1,
678 node
->u
.field_class_def
.field_class_specifier_list
,
682 bt_list_for_each_entry(iter
, &node
->u
.field_class_def
.field_class_declarators
, siblings
) {
683 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
690 case NODE_TYPEALIAS_TARGET
:
694 switch (node
->parent
->type
) {
702 ret
= _ctf_visitor_semantic_check(depth
+ 1,
703 node
->u
.field_class_alias_target
.field_class_specifier_list
,
708 bt_list_for_each_entry(iter
, &node
->u
.field_class_alias_target
.field_class_declarators
, siblings
) {
709 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
715 if (nr_declarators
> 1) {
716 _BT_COMP_LOGE_LINENO(node
->lineno
,
717 "Too many declarators in field class alias's name (maximum is 1): count=%d",
724 case NODE_TYPEALIAS_ALIAS
:
728 switch (node
->parent
->type
) {
736 ret
= _ctf_visitor_semantic_check(depth
+ 1,
737 node
->u
.field_class_alias_name
.field_class_specifier_list
,
742 bt_list_for_each_entry(iter
, &node
->u
.field_class_alias_name
.field_class_declarators
, siblings
) {
743 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
749 if (nr_declarators
> 1) {
750 _BT_COMP_LOGE_LINENO(node
->lineno
,
751 "Too many declarators in field class alias's name (maximum is 1): count=%d",
759 switch (node
->parent
->type
) {
768 case NODE_CTF_EXPRESSION
:
769 case NODE_UNARY_EXPRESSION
:
771 case NODE_TYPEALIAS_TARGET
:
772 case NODE_TYPEALIAS_ALIAS
:
774 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
775 case NODE_TYPE_SPECIFIER
:
776 case NODE_TYPE_SPECIFIER_LIST
:
778 case NODE_TYPE_DECLARATOR
:
779 case NODE_FLOATING_POINT
:
782 case NODE_ENUMERATOR
:
791 ret
= _ctf_visitor_semantic_check(depth
+ 1,
792 node
->u
.field_class_alias
.target
, log_cfg
);
795 ret
= _ctf_visitor_semantic_check(depth
+ 1,
796 node
->u
.field_class_alias
.alias
, log_cfg
);
801 case NODE_TYPE_SPECIFIER_LIST
:
802 ret
= ctf_visitor_field_class_specifier_list(depth
, node
,
807 case NODE_TYPE_SPECIFIER
:
808 ret
= ctf_visitor_field_class_specifier(depth
, node
,
814 switch (node
->parent
->type
) {
815 case NODE_TYPE_DECLARATOR
:
821 case NODE_TYPE_DECLARATOR
:
822 ret
= ctf_visitor_field_class_declarator(depth
, node
,
828 case NODE_FLOATING_POINT
:
829 switch (node
->parent
->type
) {
830 case NODE_TYPE_SPECIFIER
:
835 case NODE_UNARY_EXPRESSION
:
838 bt_list_for_each_entry(iter
, &node
->u
.floating_point
.expressions
, siblings
) {
839 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
846 switch (node
->parent
->type
) {
847 case NODE_TYPE_SPECIFIER
:
854 bt_list_for_each_entry(iter
, &node
->u
.integer
.expressions
, siblings
) {
855 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
862 switch (node
->parent
->type
) {
863 case NODE_TYPE_SPECIFIER
:
868 case NODE_UNARY_EXPRESSION
:
872 bt_list_for_each_entry(iter
, &node
->u
.string
.expressions
, siblings
) {
873 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
879 case NODE_ENUMERATOR
:
880 switch (node
->parent
->type
) {
887 * Enumerators are only allows to contain:
888 * numeric unary expression
889 * or num. unary exp. ... num. unary exp
894 bt_list_for_each_entry(iter
, &node
->u
.enumerator
.values
,
897 case 0: if (iter
->type
!= NODE_UNARY_EXPRESSION
898 || (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
899 && iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
)
900 || iter
->u
.unary_expression
.link
!= UNARY_LINK_UNKNOWN
) {
901 _BT_COMP_LOGE_LINENO(iter
->lineno
,
902 "First unary expression of enumerator is unexpected.");
906 case 1: if (iter
->type
!= NODE_UNARY_EXPRESSION
907 || (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
908 && iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
)
909 || iter
->u
.unary_expression
.link
!= UNARY_DOTDOTDOT
) {
910 _BT_COMP_LOGE_LINENO(iter
->lineno
,
911 "Second unary expression of enumerator is unexpected.");
921 bt_list_for_each_entry(iter
, &node
->u
.enumerator
.values
, siblings
) {
922 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
929 switch (node
->parent
->type
) {
930 case NODE_TYPE_SPECIFIER
:
935 case NODE_UNARY_EXPRESSION
:
940 ret
= _ctf_visitor_semantic_check(depth
+ 1,
941 node
->u
._enum
.container_field_class
, log_cfg
);
945 bt_list_for_each_entry(iter
, &node
->u
._enum
.enumerator_list
, siblings
) {
946 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
953 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
954 switch (node
->parent
->type
) {
961 ret
= _ctf_visitor_semantic_check(depth
+ 1,
962 node
->u
.struct_or_variant_declaration
.field_class_specifier_list
,
966 bt_list_for_each_entry(iter
, &node
->u
.struct_or_variant_declaration
.field_class_declarators
, siblings
) {
967 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
974 switch (node
->parent
->type
) {
975 case NODE_TYPE_SPECIFIER
:
980 case NODE_UNARY_EXPRESSION
:
983 bt_list_for_each_entry(iter
, &node
->u
.variant
.declaration_list
, siblings
) {
984 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
992 switch (node
->parent
->type
) {
993 case NODE_TYPE_SPECIFIER
:
998 case NODE_UNARY_EXPRESSION
:
1001 bt_list_for_each_entry(iter
, &node
->u
._struct
.declaration_list
, siblings
) {
1002 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
,
1011 _BT_COMP_LOGE_LINENO(node
->lineno
,
1012 "Unknown node type: type=%d", node
->type
);
1018 _BT_COMP_LOGE_LINENO(node
->lineno
,
1019 "Incoherent parent node's type: node-type=%s, parent-node-type=%s",
1020 node_type(node
), node_type(node
->parent
));
1021 return -EINVAL
; /* Incoherent structure */
1024 _BT_COMP_LOGE_LINENO(node
->lineno
,
1025 "Semantic error: node-type=%s, parent-node-type=%s",
1026 node_type(node
), node_type(node
->parent
));
1027 return -EPERM
; /* Structure not allowed */
1030 int ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
1031 struct meta_log_config
*log_cfg
)
1036 * First make sure we create the parent links for all children. Let's
1037 * take the safe route and recreate them at each validation, just in
1038 * case the structure has changed.
1040 ret
= ctf_visitor_parent_links(depth
, node
, log_cfg
);
1042 _BT_COMP_LOGE_LINENO(node
->lineno
,
1043 "Cannot create parent links in metadata's AST: "
1048 ret
= _ctf_visitor_semantic_check(depth
, node
, log_cfg
);
1050 _BT_COMP_LOGE_LINENO(node
->lineno
,
1051 "Cannot check metadata's AST semantics: "