2 * SPDX-License-Identifier: MIT
4 * Copyright 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * Common Trace Format Metadata Semantic Validator.
12 #include "logging.hpp"
14 #include "common/list.h"
18 #define _bt_list_first_entry(ptr, type, member) bt_list_entry((ptr)->next, type, member)
20 static int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
,
21 const bt2c::Logger
& logger
);
23 static int ctf_visitor_unary_expression(int, struct ctf_node
*node
, const bt2c::Logger
& logger
)
25 struct ctf_node
*iter
;
26 int is_ctf_exp
= 0, is_ctf_exp_left
= 0;
28 switch (node
->parent
->type
) {
29 case NODE_CTF_EXPRESSION
:
31 bt_list_for_each_entry (iter
, &node
->parent
->u
.ctf_expression
.left
, siblings
) {
35 * We are a left child of a ctf expression.
36 * We are only allowed to be a string.
38 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
39 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
41 "Left child of a CTF expression is only allowed to be a string.");
47 /* Right child of a ctf expression can be any type of unary exp. */
49 case NODE_TYPE_DECLARATOR
:
51 * We are the length of a type declarator.
53 switch (node
->u
.unary_expression
.type
) {
54 case UNARY_UNSIGNED_CONSTANT
:
58 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
60 "Children of field class declarator and `enum` can only be unsigned numeric constants or references to fields (e.g., `a.b.c`).");
67 * We are the size of a struct align attribute.
69 switch (node
->u
.unary_expression
.type
) {
70 case UNARY_UNSIGNED_CONSTANT
:
73 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
75 "Structure alignment attribute can only be an unsigned numeric constant.");
81 /* The enumerator's parent has validated its validity already. */
84 case NODE_UNARY_EXPRESSION
:
86 * We disallow nested unary expressions and "sbrac" unary
89 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
,
90 "Nested unary expressions not allowed (`()` and `[]`).");
101 case NODE_TYPEALIAS_TARGET
:
102 case NODE_TYPEALIAS_ALIAS
:
104 case NODE_TYPE_SPECIFIER
:
106 case NODE_FLOATING_POINT
:
110 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
116 switch (node
->u
.unary_expression
.link
) {
117 case UNARY_LINK_UNKNOWN
:
118 /* We don't allow empty link except on the first node of the list */
120 _bt_list_first_entry(is_ctf_exp_left
? &node
->parent
->u
.ctf_expression
.left
:
121 &node
->parent
->u
.ctf_expression
.right
,
122 struct ctf_node
, siblings
) != node
) {
123 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
124 logger
, node
->lineno
,
125 "Empty link is not allowed except on first node of unary expression (need to separate nodes with `.` or `->`).");
130 case UNARY_ARROWLINK
:
131 /* We only allow -> and . links between children of ctf_expression. */
132 if (node
->parent
->type
!= NODE_CTF_EXPRESSION
) {
133 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
134 logger
, node
->lineno
,
135 "Links `.` and `->` are only allowed as children of CTF expression.");
139 * Only strings can be separated linked by . or ->.
140 * This includes "", '' and non-quoted identifiers.
142 if (node
->u
.unary_expression
.type
!= UNARY_STRING
) {
143 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
144 logger
, node
->lineno
,
145 "Links `.` and `->` are only allowed to separate strings and identifiers.");
148 /* We don't allow link on the first node of the list */
150 _bt_list_first_entry(is_ctf_exp_left
? &node
->parent
->u
.ctf_expression
.left
:
151 &node
->parent
->u
.ctf_expression
.right
,
152 struct ctf_node
, siblings
) == node
) {
153 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
154 logger
, node
->lineno
,
155 "Links `.` and `->` are not allowed before first node of the unary expression list.");
159 case UNARY_DOTDOTDOT
:
160 /* We only allow ... link between children of enumerator. */
161 if (node
->parent
->type
!= NODE_ENUMERATOR
) {
162 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
,
163 "Link `...` is only allowed within enumerator.");
166 /* We don't allow link on the first node of the list */
167 if (_bt_list_first_entry(&node
->parent
->u
.enumerator
.values
, struct ctf_node
, siblings
) ==
169 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
170 logger
, node
->lineno
,
171 "Link `...` is not allowed on the first node of the unary expression list.");
176 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
,
177 "Unknown expression link type: type={}",
178 (int) node
->u
.unary_expression
.link
);
184 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
185 logger
, node
->lineno
, "Incoherent parent node's type: node-type={}, parent-node-type={}",
186 node_type(node
), node_type(node
->parent
));
187 return -EINVAL
; /* Incoherent structure */
190 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
,
191 "Semantic error: node-type={}, parent-node-type={}",
192 node_type(node
), node_type(node
->parent
));
193 return -EPERM
; /* Structure not allowed */
196 static int ctf_visitor_field_class_specifier_list(int, struct ctf_node
*node
,
197 const bt2c::Logger
& logger
)
199 switch (node
->parent
->type
) {
200 case NODE_CTF_EXPRESSION
:
201 case NODE_TYPE_DECLARATOR
:
203 case NODE_TYPEALIAS_TARGET
:
204 case NODE_TYPEALIAS_ALIAS
:
206 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
216 case NODE_UNARY_EXPRESSION
:
218 case NODE_TYPE_SPECIFIER
:
219 case NODE_TYPE_SPECIFIER_LIST
:
221 case NODE_FLOATING_POINT
:
224 case NODE_ENUMERATOR
:
232 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
233 logger
, node
->lineno
, "Incoherent parent node's type: node-type={}, parent-node-type={}",
234 node_type(node
), node_type(node
->parent
));
235 return -EINVAL
; /* Incoherent structure */
238 static int ctf_visitor_field_class_specifier(int, struct ctf_node
*node
, const bt2c::Logger
& logger
)
240 switch (node
->parent
->type
) {
241 case NODE_TYPE_SPECIFIER_LIST
:
244 case NODE_CTF_EXPRESSION
:
245 case NODE_TYPE_DECLARATOR
:
247 case NODE_TYPEALIAS_TARGET
:
248 case NODE_TYPEALIAS_ALIAS
:
250 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
258 case NODE_UNARY_EXPRESSION
:
260 case NODE_TYPE_SPECIFIER
:
262 case NODE_FLOATING_POINT
:
265 case NODE_ENUMERATOR
:
273 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
274 logger
, node
->lineno
, "Incoherent parent node's type: node-type={}, parent-node-type={}",
275 node_type(node
), node_type(node
->parent
));
276 return -EINVAL
; /* Incoherent structure */
279 static int ctf_visitor_field_class_declarator(int depth
, struct ctf_node
*node
,
280 const bt2c::Logger
& logger
)
283 struct ctf_node
*iter
;
287 switch (node
->parent
->type
) {
288 case NODE_TYPE_DECLARATOR
:
290 * A nested field class declarator is not allowed to
293 if (!bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
296 case NODE_TYPEALIAS_TARGET
:
298 case NODE_TYPEALIAS_ALIAS
:
300 * Only accept alias name containing:
302 * - identifier * (any number of pointers)
303 * NOT accepting alias names containing [] (would otherwise
304 * cause semantic clash for later declarations of
305 * arrays/sequences of elements, where elements could be
306 * arrays/sequences themselves (if allowed in field class alias).
307 * NOT accepting alias with identifier. The declarator should
308 * be either empty or contain pointer(s).
310 if (node
->u
.field_class_declarator
.type
== TYPEDEC_NESTED
)
312 bt_list_for_each_entry (iter
,
313 &node
->parent
->u
.field_class_alias_name
.field_class_specifier_list
314 ->u
.field_class_specifier_list
.head
,
316 switch (iter
->u
.field_class_specifier
.type
) {
317 case TYPESPEC_FLOATING_POINT
:
318 case TYPESPEC_INTEGER
:
319 case TYPESPEC_STRING
:
320 case TYPESPEC_STRUCT
:
321 case TYPESPEC_VARIANT
:
323 if (bt_list_empty(&node
->u
.field_class_declarator
.pointers
))
330 if (node
->u
.field_class_declarator
.type
== TYPEDEC_ID
&&
331 node
->u
.field_class_declarator
.u
.id
)
335 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
345 case NODE_CTF_EXPRESSION
:
346 case NODE_UNARY_EXPRESSION
:
348 case NODE_TYPE_SPECIFIER
:
350 case NODE_FLOATING_POINT
:
353 case NODE_ENUMERATOR
:
361 bt_list_for_each_entry (iter
, &node
->u
.field_class_declarator
.pointers
, siblings
) {
362 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
367 switch (node
->u
.field_class_declarator
.type
) {
372 if (node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
) {
373 ret
= _ctf_visitor_semantic_check(
374 depth
+ 1, node
->u
.field_class_declarator
.u
.nested
.field_class_declarator
, logger
);
378 if (!node
->u
.field_class_declarator
.u
.nested
.abstract_array
) {
379 bt_list_for_each_entry (iter
, &node
->u
.field_class_declarator
.u
.nested
.length
,
381 if (iter
->type
!= NODE_UNARY_EXPRESSION
) {
382 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
383 logger
, node
->lineno
, "Expecting unary expression as length: node-type={}",
387 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
392 if (node
->parent
->type
== NODE_TYPEALIAS_TARGET
) {
393 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
394 logger
, node
->lineno
,
395 "Abstract array declarator not permitted as target of field class alias.");
399 if (node
->u
.field_class_declarator
.bitfield_len
) {
400 ret
= _ctf_visitor_semantic_check(depth
+ 1,
401 node
->u
.field_class_declarator
.bitfield_len
, logger
);
407 case TYPEDEC_UNKNOWN
:
409 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
,
410 "Unknown field class declarator: type={}",
411 (int) node
->u
.field_class_declarator
.type
);
418 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
419 logger
, node
->lineno
, "Incoherent parent node's type: node-type={}, parent-node-type={}",
420 node_type(node
), node_type(node
->parent
));
421 return -EINVAL
; /* Incoherent structure */
424 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
,
425 "Semantic error: node-type={}, parent-node-type={}",
426 node_type(node
), node_type(node
->parent
));
427 return -EPERM
; /* Structure not allowed */
430 static int _ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
, const bt2c::Logger
& logger
)
433 struct ctf_node
*iter
;
438 switch (node
->type
) {
440 bt_list_for_each_entry (iter
, &node
->u
.root
.declaration_list
, siblings
) {
441 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
445 bt_list_for_each_entry (iter
, &node
->u
.root
.trace
, siblings
) {
446 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
450 bt_list_for_each_entry (iter
, &node
->u
.root
.stream
, siblings
) {
451 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
455 bt_list_for_each_entry (iter
, &node
->u
.root
.event
, siblings
) {
456 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
463 switch (node
->parent
->type
) {
470 bt_list_for_each_entry (iter
, &node
->u
.event
.declaration_list
, siblings
) {
471 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
477 switch (node
->parent
->type
) {
484 bt_list_for_each_entry (iter
, &node
->u
.stream
.declaration_list
, siblings
) {
485 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
491 switch (node
->parent
->type
) {
498 bt_list_for_each_entry (iter
, &node
->u
.env
.declaration_list
, siblings
) {
499 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
505 switch (node
->parent
->type
) {
512 bt_list_for_each_entry (iter
, &node
->u
.trace
.declaration_list
, siblings
) {
513 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
519 switch (node
->parent
->type
) {
526 bt_list_for_each_entry (iter
, &node
->u
.clock
.declaration_list
, siblings
) {
527 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
533 switch (node
->parent
->type
) {
540 bt_list_for_each_entry (iter
, &node
->u
.callsite
.declaration_list
, siblings
) {
541 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
547 case NODE_CTF_EXPRESSION
:
548 switch (node
->parent
->type
) {
556 case NODE_FLOATING_POINT
:
561 case NODE_CTF_EXPRESSION
:
562 case NODE_UNARY_EXPRESSION
:
564 case NODE_TYPEALIAS_TARGET
:
565 case NODE_TYPEALIAS_ALIAS
:
566 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
568 case NODE_TYPE_SPECIFIER
:
569 case NODE_TYPE_SPECIFIER_LIST
:
571 case NODE_TYPE_DECLARATOR
:
572 case NODE_ENUMERATOR
:
581 bt_list_for_each_entry (iter
, &node
->u
.ctf_expression
.left
, siblings
) {
582 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
586 bt_list_for_each_entry (iter
, &node
->u
.ctf_expression
.right
, siblings
) {
587 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
593 case NODE_UNARY_EXPRESSION
:
594 return ctf_visitor_unary_expression(depth
, node
, logger
);
597 switch (node
->parent
->type
) {
606 case NODE_CTF_EXPRESSION
:
607 case NODE_UNARY_EXPRESSION
:
609 case NODE_TYPEALIAS_TARGET
:
610 case NODE_TYPEALIAS_ALIAS
:
612 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_FLOATING_POINT
:
620 case NODE_ENUMERATOR
:
630 ret
= _ctf_visitor_semantic_check(
631 depth
+ 1, node
->u
.field_class_def
.field_class_specifier_list
, logger
);
634 bt_list_for_each_entry (iter
, &node
->u
.field_class_def
.field_class_declarators
, siblings
) {
635 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
641 case NODE_TYPEALIAS_TARGET
:
645 switch (node
->parent
->type
) {
653 ret
= _ctf_visitor_semantic_check(
654 depth
+ 1, node
->u
.field_class_alias_target
.field_class_specifier_list
, logger
);
658 bt_list_for_each_entry (iter
, &node
->u
.field_class_alias_target
.field_class_declarators
,
660 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
665 if (nr_declarators
> 1) {
666 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
667 logger
, node
->lineno
,
668 "Too many declarators in field class alias's name (maximum is 1): count={}",
675 case NODE_TYPEALIAS_ALIAS
:
679 switch (node
->parent
->type
) {
687 ret
= _ctf_visitor_semantic_check(
688 depth
+ 1, node
->u
.field_class_alias_name
.field_class_specifier_list
, logger
);
692 bt_list_for_each_entry (iter
, &node
->u
.field_class_alias_name
.field_class_declarators
,
694 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
699 if (nr_declarators
> 1) {
700 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
701 logger
, node
->lineno
,
702 "Too many declarators in field class alias's name (maximum is 1): count={}",
710 switch (node
->parent
->type
) {
719 case NODE_CTF_EXPRESSION
:
720 case NODE_UNARY_EXPRESSION
:
722 case NODE_TYPEALIAS_TARGET
:
723 case NODE_TYPEALIAS_ALIAS
:
725 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
726 case NODE_TYPE_SPECIFIER
:
727 case NODE_TYPE_SPECIFIER_LIST
:
729 case NODE_TYPE_DECLARATOR
:
730 case NODE_FLOATING_POINT
:
733 case NODE_ENUMERATOR
:
742 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
.field_class_alias
.target
, logger
);
745 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
.field_class_alias
.alias
, logger
);
750 case NODE_TYPE_SPECIFIER_LIST
:
751 ret
= ctf_visitor_field_class_specifier_list(depth
, node
, logger
);
755 case NODE_TYPE_SPECIFIER
:
756 ret
= ctf_visitor_field_class_specifier(depth
, node
, logger
);
761 switch (node
->parent
->type
) {
762 case NODE_TYPE_DECLARATOR
:
768 case NODE_TYPE_DECLARATOR
:
769 ret
= ctf_visitor_field_class_declarator(depth
, node
, logger
);
774 case NODE_FLOATING_POINT
:
775 switch (node
->parent
->type
) {
776 case NODE_TYPE_SPECIFIER
:
781 case NODE_UNARY_EXPRESSION
:
784 bt_list_for_each_entry (iter
, &node
->u
.floating_point
.expressions
, siblings
) {
785 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
791 switch (node
->parent
->type
) {
792 case NODE_TYPE_SPECIFIER
:
798 bt_list_for_each_entry (iter
, &node
->u
.integer
.expressions
, siblings
) {
799 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
805 switch (node
->parent
->type
) {
806 case NODE_TYPE_SPECIFIER
:
811 case NODE_UNARY_EXPRESSION
:
815 bt_list_for_each_entry (iter
, &node
->u
.string
.expressions
, siblings
) {
816 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
821 case NODE_ENUMERATOR
:
822 switch (node
->parent
->type
) {
829 * Enumerators are only allows to contain:
830 * numeric unary expression
831 * or num. unary exp. ... num. unary exp
836 bt_list_for_each_entry (iter
, &node
->u
.enumerator
.values
, siblings
) {
839 if (iter
->type
!= NODE_UNARY_EXPRESSION
||
840 (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
&&
841 iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
) ||
842 iter
->u
.unary_expression
.link
!= UNARY_LINK_UNKNOWN
) {
843 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
844 logger
, iter
->lineno
,
845 "First unary expression of enumerator is unexpected.");
850 if (iter
->type
!= NODE_UNARY_EXPRESSION
||
851 (iter
->u
.unary_expression
.type
!= UNARY_SIGNED_CONSTANT
&&
852 iter
->u
.unary_expression
.type
!= UNARY_UNSIGNED_CONSTANT
) ||
853 iter
->u
.unary_expression
.link
!= UNARY_DOTDOTDOT
) {
854 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
855 logger
, iter
->lineno
,
856 "Second unary expression of enumerator is unexpected.");
866 bt_list_for_each_entry (iter
, &node
->u
.enumerator
.values
, siblings
) {
867 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
873 switch (node
->parent
->type
) {
874 case NODE_TYPE_SPECIFIER
:
879 case NODE_UNARY_EXPRESSION
:
884 ret
= _ctf_visitor_semantic_check(depth
+ 1, node
->u
._enum
.container_field_class
, logger
);
888 bt_list_for_each_entry (iter
, &node
->u
._enum
.enumerator_list
, siblings
) {
889 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
895 case NODE_STRUCT_OR_VARIANT_DECLARATION
:
896 switch (node
->parent
->type
) {
903 ret
= _ctf_visitor_semantic_check(
904 depth
+ 1, node
->u
.struct_or_variant_declaration
.field_class_specifier_list
, logger
);
907 bt_list_for_each_entry (
908 iter
, &node
->u
.struct_or_variant_declaration
.field_class_declarators
, siblings
) {
909 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
915 switch (node
->parent
->type
) {
916 case NODE_TYPE_SPECIFIER
:
921 case NODE_UNARY_EXPRESSION
:
924 bt_list_for_each_entry (iter
, &node
->u
.variant
.declaration_list
, siblings
) {
925 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
932 switch (node
->parent
->type
) {
933 case NODE_TYPE_SPECIFIER
:
938 case NODE_UNARY_EXPRESSION
:
941 bt_list_for_each_entry (iter
, &node
->u
._struct
.declaration_list
, siblings
) {
942 ret
= _ctf_visitor_semantic_check(depth
+ 1, iter
, logger
);
950 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
, "Unknown node type: type={}",
957 _BT_CPPLOGE_APPEND_CAUSE_LINENO(
958 logger
, node
->lineno
, "Incoherent parent node's type: node-type={}, parent-node-type={}",
959 node_type(node
), node_type(node
->parent
));
960 return -EINVAL
; /* Incoherent structure */
963 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
,
964 "Semantic error: node-type={}, parent-node-type={}",
965 node_type(node
), node_type(node
->parent
));
966 return -EPERM
; /* Structure not allowed */
969 int ctf_visitor_semantic_check(int depth
, struct ctf_node
*node
, const bt2c::Logger
& parentLogger
)
972 bt2c::Logger logger
{parentLogger
, "PLUGIN/CTF/META/SEMANTIC-VALIDATOR-VISITOR"};
975 * First make sure we create the parent links for all children. Let's
976 * take the safe route and recreate them at each validation, just in
977 * case the structure has changed.
979 ret
= ctf_visitor_parent_links(depth
, node
, logger
);
981 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
,
982 "Cannot create parent links in metadata's AST: "
988 ret
= _ctf_visitor_semantic_check(depth
, node
, logger
);
990 _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger
, node
->lineno
,
991 "Cannot check metadata's AST semantics: "