ctf: move ctf_visitor_generate_ir to header file
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 9 Apr 2024 20:29:13 +0000 (16:29 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -0400)
Move ctf_visitor_generate_ir to the `ast.h` header file, the header file
containing all the declarations for the CTF 1 metadata visitors.  This
will allow exposing it as a proper C++ class and remove the accessor
functions.

Change-Id: Ic13494d0040ee9e2214ecca45d8ea2e7b75ec4fa
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8162
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12264
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/common/src/metadata/tsdl/ast.hpp
src/plugins/ctf/common/src/metadata/tsdl/visitor-generate-ir.cpp

index fcd33843c8844ad20bdc73deebd77c598c0f19a4..962dad553b4f67c1a0ef0bc08ca4e3bb0ceb8ccb 100644 (file)
@@ -475,6 +475,36 @@ struct ctf_ast
 
 const char *node_type(struct ctf_node *node);
 
+struct ctf_visitor_generate_ir
+{
+    explicit ctf_visitor_generate_ir(ctf_metadata_decoder_config decoderConfig,
+                                     bt2c::Logger loggerParam) :
+        decoder_config {std::move(decoderConfig)},
+        logger {std::move(loggerParam)}
+    {
+    }
+
+    /* Trace IR trace class being filled (owned by this) */
+    bt_trace_class *trace_class = nullptr;
+
+    /* CTF meta trace being filled (owned by this) */
+    struct ctf_trace_class *ctf_tc = nullptr;
+
+    /* Current declaration scope (top of the stack) (owned by this) */
+    struct ctx_decl_scope *current_scope = nullptr;
+
+    /* True if trace declaration is visited */
+    bool is_trace_visited = false;
+
+    /* True if this is an LTTng trace */
+    bool is_lttng = false;
+
+    /* Config passed by the user */
+    struct ctf_metadata_decoder_config decoder_config;
+
+    bt2c::Logger logger;
+};
+
 struct ctf_visitor_generate_ir *
 ctf_visitor_generate_ir_create(const struct ctf_metadata_decoder_config *config);
 
index ac04a7fa4cd7fac639e7397fe139a79ce3156630..41d7410cb97eca8f17b595aae42f03407ad32803 100644 (file)
@@ -168,44 +168,6 @@ struct ctx_decl_scope
     struct ctx_decl_scope *parent_scope;
 };
 
-/*
- * Visitor context (private).
- */
-struct ctf_visitor_generate_ir
-{
-    explicit ctf_visitor_generate_ir(ctf_metadata_decoder_config decoderConfig,
-                                     bt2c::Logger loggerParam) :
-        decoder_config {std::move(decoderConfig)},
-        logger {std::move(loggerParam)}
-    {
-    }
-
-    /* Trace IR trace class being filled (owned by this) */
-    bt_trace_class *trace_class = nullptr;
-
-    /* CTF meta trace being filled (owned by this) */
-    struct ctf_trace_class *ctf_tc = nullptr;
-
-    /* Current declaration scope (top of the stack) (owned by this) */
-    struct ctx_decl_scope *current_scope = nullptr;
-
-    /* True if trace declaration is visited */
-    bool is_trace_visited = false;
-
-    /* True if this is an LTTng trace */
-    bool is_lttng = false;
-
-    /* Config passed by the user */
-    struct ctf_metadata_decoder_config decoder_config;
-
-    bt2c::Logger logger;
-};
-
-/*
- * Visitor (public).
- */
-struct ctf_visitor_generate_ir;
-
 /**
  * Creates a new declaration scope.
  *
This page took 0.026728 seconds and 4 git commands to generate.