projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename: field type -> field class
[babeltrace.git]
/
plugins
/
ctf
/
common
/
metadata
/
visitor-parent-links.c
diff --git
a/plugins/ctf/common/metadata/visitor-parent-links.c
b/plugins/ctf/common/metadata/visitor-parent-links.c
index 028e477753ede41d67da79ca35f049c1f70e2d25..2ee9579d3ccce0447f313f3e3131c5ba36a54e2c 100644
(file)
--- a/
plugins/ctf/common/metadata/visitor-parent-links.c
+++ b/
plugins/ctf/common/metadata/visitor-parent-links.c
@@
-24,11
+24,14
@@
* SOFTWARE.
*/
* SOFTWARE.
*/
+#define BT_LOG_TAG "PLUGIN-CTF-METADATA-PARENT-LINKS-VISITOR"
+#include "logging.h"
+
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
-#include <
assert
.h>
+#include <
babeltrace/assert-internal
.h>
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
@@
-38,9
+41,6
@@
#include "parser.h"
#include "ast.h"
#include "parser.h"
#include "ast.h"
-#define BT_LOG_TAG "PLUGIN-CTF-METADATA-VISITOR-PARENT-LINKS"
-#include "logging.h"
-
static
int ctf_visitor_unary_expression(int depth, struct ctf_node *node)
{
static
int ctf_visitor_unary_expression(int depth, struct ctf_node *node)
{
@@
-53,8
+53,9
@@
int ctf_visitor_unary_expression(int depth, struct ctf_node *node)
case UNARY_DOTDOTDOT:
break;
default:
case UNARY_DOTDOTDOT:
break;
default:
- BT_LOGE("unknown expression link type %d\n",
- (int) node->u.unary_expression.link);
+ _BT_LOGE_LINENO(node->lineno,
+ "Unknown expression link type: type=%d\n",
+ node->u.unary_expression.link);
return -EINVAL;
}
return -EINVAL;
}
@@
-73,8
+74,9
@@
int ctf_visitor_unary_expression(int depth, struct ctf_node *node)
case UNARY_UNKNOWN:
default:
case UNARY_UNKNOWN:
default:
- BT_LOGE("unknown expression type %d\n",
- (int) node->u.unary_expression.type);
+ _BT_LOGE_LINENO(node->lineno,
+ "Unknown expression link type: type=%d\n",
+ node->u.unary_expression.link);
return -EINVAL;
}
return 0;
return -EINVAL;
}
return 0;
@@
-85,7
+87,7
@@
int ctf_visitor_type_specifier(int depth, struct ctf_node *node)
{
int ret;
{
int ret;
- switch (node->u.
type
_specifier.type) {
+ switch (node->u.
field_class
_specifier.type) {
case TYPESPEC_VOID:
case TYPESPEC_CHAR:
case TYPESPEC_SHORT:
case TYPESPEC_VOID:
case TYPESPEC_CHAR:
case TYPESPEC_SHORT:
@@
-107,30
+109,31
@@
int ctf_visitor_type_specifier(int depth, struct ctf_node *node)
case TYPESPEC_STRUCT:
case TYPESPEC_VARIANT:
case TYPESPEC_ENUM:
case TYPESPEC_STRUCT:
case TYPESPEC_VARIANT:
case TYPESPEC_ENUM:
- node->u.
type
_specifier.node->parent = node;
- ret = ctf_visitor_parent_links(depth + 1, node->u.
type
_specifier.node);
+ node->u.
field_class
_specifier.node->parent = node;
+ ret = ctf_visitor_parent_links(depth + 1, node->u.
field_class
_specifier.node);
if (ret)
return ret;
break;
case TYPESPEC_UNKNOWN:
default:
if (ret)
return ret;
break;
case TYPESPEC_UNKNOWN:
default:
- BT_LOGE("unknown type specifier %d\n",
- (int) node->u.type_specifier.type);
+ _BT_LOGE_LINENO(node->lineno,
+ "Unknown type specifier: type=%d\n",
+ node->u.field_class_specifier.type);
return -EINVAL;
}
return 0;
}
static
return -EINVAL;
}
return 0;
}
static
-int ctf_visitor_
type
_declarator(int depth, struct ctf_node *node)
+int ctf_visitor_
field_class
_declarator(int depth, struct ctf_node *node)
{
int ret = 0;
struct ctf_node *iter;
depth++;
{
int ret = 0;
struct ctf_node *iter;
depth++;
- bt_list_for_each_entry(iter, &node->u.
type
_declarator.pointers,
+ bt_list_for_each_entry(iter, &node->u.
field_class
_declarator.pointers,
siblings) {
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
siblings) {
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
@@
-138,19
+141,19
@@
int ctf_visitor_type_declarator(int depth, struct ctf_node *node)
return ret;
}
return ret;
}
- switch (node->u.
type
_declarator.type) {
+ switch (node->u.
field_class
_declarator.type) {
case TYPEDEC_ID:
break;
case TYPEDEC_NESTED:
case TYPEDEC_ID:
break;
case TYPEDEC_NESTED:
- if (node->u.
type_declarator.u.nested.type
_declarator) {
- node->u.
type_declarator.u.nested.type
_declarator->parent = node;
+ if (node->u.
field_class_declarator.u.nested.field_class
_declarator) {
+ node->u.
field_class_declarator.u.nested.field_class
_declarator->parent = node;
ret = ctf_visitor_parent_links(depth + 1,
ret = ctf_visitor_parent_links(depth + 1,
- node->u.
type_declarator.u.nested.type
_declarator);
+ node->u.
field_class_declarator.u.nested.field_class
_declarator);
if (ret)
return ret;
}
if (ret)
return ret;
}
- if (!node->u.
type
_declarator.u.nested.abstract_array) {
- bt_list_for_each_entry(iter, &node->u.
type
_declarator.u.nested.length,
+ if (!node->u.
field_class
_declarator.u.nested.abstract_array) {
+ bt_list_for_each_entry(iter, &node->u.
field_class
_declarator.u.nested.length,
siblings) {
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
siblings) {
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
@@
-158,18
+161,19
@@
int ctf_visitor_type_declarator(int depth, struct ctf_node *node)
return ret;
}
}
return ret;
}
}
- if (node->u.
type
_declarator.bitfield_len) {
- node->u.
type
_declarator.bitfield_len = node;
+ if (node->u.
field_class
_declarator.bitfield_len) {
+ node->u.
field_class
_declarator.bitfield_len = node;
ret = ctf_visitor_parent_links(depth + 1,
ret = ctf_visitor_parent_links(depth + 1,
- node->u.
type
_declarator.bitfield_len);
+ node->u.
field_class
_declarator.bitfield_len);
if (ret)
return ret;
}
break;
case TYPEDEC_UNKNOWN:
default:
if (ret)
return ret;
}
break;
case TYPEDEC_UNKNOWN:
default:
- BT_LOGE("unknown type declarator %d\n",
- (int) node->u.type_declarator.type);
+ _BT_LOGE_LINENO(node->lineno,
+ "Unknown type declarator: type=%d\n",
+ node->u.field_class_declarator.type);
return -EINVAL;
}
depth--;
return -EINVAL;
}
depth--;
@@
-294,11
+298,11
@@
int ctf_visitor_parent_links(int depth, struct ctf_node *node)
case NODE_TYPEDEF:
depth++;
case NODE_TYPEDEF:
depth++;
- node->u.
_typedef.type
_specifier_list->parent = node;
- ret = ctf_visitor_parent_links(depth + 1, node->u.
_typedef.type
_specifier_list);
+ node->u.
field_class_def.field_class
_specifier_list->parent = node;
+ ret = ctf_visitor_parent_links(depth + 1, node->u.
field_class_def.field_class
_specifier_list);
if (ret)
return ret;
if (ret)
return ret;
- bt_list_for_each_entry(iter, &node->u.
_typedef.type
_declarators, siblings) {
+ bt_list_for_each_entry(iter, &node->u.
field_class_def.field_class
_declarators, siblings) {
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
@@
-308,11
+312,11
@@
int ctf_visitor_parent_links(int depth, struct ctf_node *node)
break;
case NODE_TYPEALIAS_TARGET:
depth++;
break;
case NODE_TYPEALIAS_TARGET:
depth++;
- node->u.
typealias_target.type
_specifier_list->parent = node;
- ret = ctf_visitor_parent_links(depth + 1, node->u.
typealias_target.type
_specifier_list);
+ node->u.
field_class_alias_target.field_class
_specifier_list->parent = node;
+ ret = ctf_visitor_parent_links(depth + 1, node->u.
field_class_alias_target.field_class
_specifier_list);
if (ret)
return ret;
if (ret)
return ret;
- bt_list_for_each_entry(iter, &node->u.
typealias_target.type
_declarators, siblings) {
+ bt_list_for_each_entry(iter, &node->u.
field_class_alias_target.field_class
_declarators, siblings) {
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
@@
-322,11
+326,11
@@
int ctf_visitor_parent_links(int depth, struct ctf_node *node)
break;
case NODE_TYPEALIAS_ALIAS:
depth++;
break;
case NODE_TYPEALIAS_ALIAS:
depth++;
- node->u.
typealias_alias.type
_specifier_list->parent = node;
- ret = ctf_visitor_parent_links(depth + 1, node->u.
typealias_alias.type
_specifier_list);
+ node->u.
field_class_alias_name.field_class
_specifier_list->parent = node;
+ ret = ctf_visitor_parent_links(depth + 1, node->u.
field_class_alias_name.field_class
_specifier_list);
if (ret)
return ret;
if (ret)
return ret;
- bt_list_for_each_entry(iter, &node->u.
typealias_alias.type
_declarators, siblings) {
+ bt_list_for_each_entry(iter, &node->u.
field_class_alias_name.field_class
_declarators, siblings) {
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
@@
-335,18
+339,18
@@
int ctf_visitor_parent_links(int depth, struct ctf_node *node)
depth--;
break;
case NODE_TYPEALIAS:
depth--;
break;
case NODE_TYPEALIAS:
- node->u.
type
alias.target->parent = node;
- ret = ctf_visitor_parent_links(depth + 1, node->u.
type
alias.target);
+ node->u.
field_class_
alias.target->parent = node;
+ ret = ctf_visitor_parent_links(depth + 1, node->u.
field_class_
alias.target);
if (ret)
return ret;
if (ret)
return ret;
- node->u.
type
alias.alias->parent = node;
- ret = ctf_visitor_parent_links(depth + 1, node->u.
type
alias.alias);
+ node->u.
field_class_
alias.alias->parent = node;
+ ret = ctf_visitor_parent_links(depth + 1, node->u.
field_class_
alias.alias);
if (ret)
return ret;
break;
case NODE_TYPE_SPECIFIER_LIST:
if (ret)
return ret;
break;
case NODE_TYPE_SPECIFIER_LIST:
- bt_list_for_each_entry(iter, &node->u.
type
_specifier_list.head, siblings) {
+ bt_list_for_each_entry(iter, &node->u.
field_class
_specifier_list.head, siblings) {
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
@@
-362,7
+366,7
@@
int ctf_visitor_parent_links(int depth, struct ctf_node *node)
case NODE_POINTER:
break;
case NODE_TYPE_DECLARATOR:
case NODE_POINTER:
break;
case NODE_TYPE_DECLARATOR:
- ret = ctf_visitor_
type
_declarator(depth, node);
+ ret = ctf_visitor_
field_class
_declarator(depth, node);
if (ret)
return ret;
break;
if (ret)
return ret;
break;
@@
-401,8
+405,8
@@
int ctf_visitor_parent_links(int depth, struct ctf_node *node)
break;
case NODE_ENUM:
depth++;
break;
case NODE_ENUM:
depth++;
- if (node->u._enum.container_
type
) {
- ret = ctf_visitor_parent_links(depth + 1, node->u._enum.container_
type
);
+ if (node->u._enum.container_
field_class
) {
+ ret = ctf_visitor_parent_links(depth + 1, node->u._enum.container_
field_class
);
if (ret)
return ret;
}
if (ret)
return ret;
}
@@
-416,12
+420,12
@@
int ctf_visitor_parent_links(int depth, struct ctf_node *node)
depth--;
break;
case NODE_STRUCT_OR_VARIANT_DECLARATION:
depth--;
break;
case NODE_STRUCT_OR_VARIANT_DECLARATION:
- node->u.struct_or_variant_declaration.
type
_specifier_list->parent = node;
+ node->u.struct_or_variant_declaration.
field_class
_specifier_list->parent = node;
ret = ctf_visitor_parent_links(depth + 1,
ret = ctf_visitor_parent_links(depth + 1,
- node->u.struct_or_variant_declaration.
type
_specifier_list);
+ node->u.struct_or_variant_declaration.
field_class
_specifier_list);
if (ret)
return ret;
if (ret)
return ret;
- bt_list_for_each_entry(iter, &node->u.struct_or_variant_declaration.
type
_declarators, siblings) {
+ bt_list_for_each_entry(iter, &node->u.struct_or_variant_declaration.
field_class
_declarators, siblings) {
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
iter->parent = node;
ret = ctf_visitor_parent_links(depth + 1, iter);
if (ret)
@@
-454,7
+458,8
@@
int ctf_visitor_parent_links(int depth, struct ctf_node *node)
case NODE_UNKNOWN:
default:
case NODE_UNKNOWN:
default:
- BT_LOGE("unknown node type %d\n", (int) node->type);
+ _BT_LOGE_LINENO(node->lineno,
+ "Unknown node type: type=%d\n", node->type);
return -EINVAL;
}
return ret;
return -EINVAL;
}
return ret;
This page took
0.028041 seconds
and
4
git commands to generate.