Skip to content

Commit

Permalink
cc: Splice codegen generator into ast consumer.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Oct 25, 2023
1 parent ec7017d commit 0d45eaf
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 221 deletions.
3 changes: 1 addition & 2 deletions include/vast/CodeGen/CodeGenDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ namespace vast::cg
struct codegen_driver {

explicit codegen_driver(
codegen_context &cgctx
, codegen_options opts
codegen_context &cgctx, codegen_options opts
)
: actx(cgctx.actx)
, mctx(cgctx.mctx)
Expand Down
69 changes: 0 additions & 69 deletions include/vast/CodeGen/Generator.hpp

This file was deleted.

15 changes: 5 additions & 10 deletions include/vast/Frontend/Consumer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ VAST_UNRELAX_WARNINGS
#include "vast/Frontend/FrontendAction.hpp"
#include "vast/Frontend/Options.hpp"

#include "vast/CodeGen/Generator.hpp"
#include "vast/CodeGen/CodeGenContext.hpp"
#include "vast/CodeGen/CodeGenDriver.hpp"

namespace vast::cc {

Expand All @@ -29,8 +29,6 @@ namespace vast::cc {

struct vast_consumer : clang_ast_consumer
{
using vast_generator_ptr = std::unique_ptr< cg::vast_generator >;

vast_consumer(
output_type act, action_options opts,
const vast_args &vargs, output_stream_ptr os
Expand All @@ -39,10 +37,7 @@ namespace vast::cc {
, opts(std::move(opts))
, vargs(vargs)
, output_stream(std::move(os))
, generator(std::make_unique< cg::vast_generator >(
opts.diags, opts.codegen, opts.lang
)
) {}
{}

void Initialize(acontext_t &ctx) override;

Expand Down Expand Up @@ -95,8 +90,8 @@ namespace vast::cc {
//
// contexts
//
acontext_t *acontext = nullptr;

vast_generator_ptr generator;
std::unique_ptr< mcontext_t > mctx = nullptr;
std::unique_ptr< cg::codegen_context > cgctx = nullptr;
std::unique_ptr< cg::codegen_driver > codegen = nullptr;
};
} // namespace vast::cc
1 change: 0 additions & 1 deletion lib/vast/CodeGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ add_vast_library(CodeGen
CodeGenFunction.cpp
DataLayout.cpp
FunctionInfo.cpp
Generator.cpp
ItaniumCXXABI.cpp
Mangler.cpp
Passes.cpp
Expand Down
120 changes: 0 additions & 120 deletions lib/vast/CodeGen/Generator.cpp

This file was deleted.

Loading

0 comments on commit 0d45eaf

Please sign in to comment.