return ctx_decl_scope_register_prefix_alias(scope, _PREFIX_VARIANT, name, &decl->base);
}
-/**
- * Destroys a visitor context.
- *
- * @param ctx Visitor context to destroy
- */
-static void ctx_destroy(struct ctf_visitor_generate_ir *ctx)
+ctf_visitor_generate_ir::~ctf_visitor_generate_ir()
{
- struct ctx_decl_scope *scope;
-
- if (!ctx) {
- goto end;
- }
-
- scope = ctx->current_scope;
+ struct ctx_decl_scope *scope = this->current_scope;
/*
* Destroy all scopes, from current one to the root scope.
scope = parent_scope;
}
- if (ctx->ctf_tc) {
- ctf_trace_class_destroy(ctx->ctf_tc);
+ if (this->ctf_tc) {
+ ctf_trace_class_destroy(this->ctf_tc);
}
-
- delete ctx;
-
-end:
- return;
}
/**
return ctx;
}
-static void ctf_visitor_generate_ir_destroy(struct ctf_visitor_generate_ir *visitor)
-{
- ctx_destroy(visitor);
-}
-
-void ctf_visitor_generate_ir_deleter::operator()(ctf_visitor_generate_ir *visitor)
-{
- ctf_visitor_generate_ir_destroy(visitor);
-}
-
bt2::TraceClass::Shared
ctf_visitor_generate_ir_get_ir_trace_class(struct ctf_visitor_generate_ir *ctx)
{