#include <sdfg/codegen/code_generators/c_style_base_code_generator.h>
|
| | CStyleBaseCodeGenerator (StructuredSDFG &sdfg, analysis::AnalysisManager &analysis_manager, InstrumentationPlan &instrumentation_plan, ArgCapturePlan &arg_capture_plan, std::shared_ptr< CodeSnippetFactory > library_snippet_factory=std::make_shared< CodeSnippetFactory >(), const std::string &externals_prefix="") |
| bool | generate () override |
| | Generate the code.
|
| bool | emit_header (PrettyPrinter &out) override |
| | write the contents of the main header into out
|
| bool | emit_main_source (std::ostream &out, const std::filesystem::path &header_path) override |
| | write the contents of the main source file into out.
|
| bool | as_source (const std::filesystem::path &header_path, const std::filesystem::path &source_path) override |
| | Generate the SDFG's code into source files.
|
| void | append_function_source (std::ostream &ofs_source) override |
| | Generate only the function source code and append it to the source file.
|
| virtual void | emit_capture_context_init (std::ostream &ofs_source) const =0 |
| | CodeGenerator (StructuredSDFG &sdfg, analysis::AnalysisManager &analysis_manager, InstrumentationPlan &instrumentation_plan, ArgCapturePlan &arg_capture_plan, std::shared_ptr< CodeSnippetFactory > library_snippet_factory=std::make_shared< CodeSnippetFactory >(), const std::string &externals_prefix="") |
| virtual | ~CodeGenerator ()=default |
| const StructuredSDFG & | sdfg () const |
| virtual std::string | function_definition ()=0 |
| | Generate a function definition for the SDFG.
|
| const PrettyPrinter & | includes () const |
| | Get the includes.
|
| const PrettyPrinter & | classes () const |
| | Get the classes.
|
| const PrettyPrinter & | globals () const |
| | Get the globals.
|
| const std::unordered_map< std::string, CodeSnippet > & | library_snippets () const |
| | all created library snippets
|
| const PrettyPrinter & | main () const |
| | Get the main stream.
|
◆ CStyleBaseCodeGenerator()
◆ append_function_source()
| void sdfg::codegen::CStyleBaseCodeGenerator::append_function_source |
( |
std::ostream & | ofs_source | ) |
|
|
overridevirtual |
Generate only the function source code and append it to the source file.
as_source generates this into source_path after includes, globals and structs
Implements sdfg::codegen::CodeGenerator.
◆ as_source()
| bool sdfg::codegen::CStyleBaseCodeGenerator::as_source |
( |
const std::filesystem::path & | header_path, |
|
|
const std::filesystem::path & | source_path ) |
|
overridevirtual |
Generate the SDFG's code into source files.
- Deprecated
- this requires generate() being run manually prior and will output directly into filepaths for header and source at the same time. Which is quite restrictive. New parallel builder require [emit_header] and [emit_main_source] instead
Implements sdfg::codegen::CodeGenerator.
◆ dispatch_globals()
| virtual void sdfg::codegen::CStyleBaseCodeGenerator::dispatch_globals |
( |
| ) |
|
|
protectedpure virtual |
◆ dispatch_header()
| void sdfg::codegen::CStyleBaseCodeGenerator::dispatch_header |
( |
PrettyPrinter & | out | ) |
|
|
protected |
◆ dispatch_header_includes()
| virtual void sdfg::codegen::CStyleBaseCodeGenerator::dispatch_header_includes |
( |
PrettyPrinter & | out | ) |
|
|
protectedpure virtual |
◆ dispatch_header_structures()
| virtual void sdfg::codegen::CStyleBaseCodeGenerator::dispatch_header_structures |
( |
PrettyPrinter & | out | ) |
|
|
protectedpure virtual |
◆ dispatch_includes()
| void sdfg::codegen::CStyleBaseCodeGenerator::dispatch_includes |
( |
| ) |
|
|
protected |
◆ dispatch_schedule()
| virtual void sdfg::codegen::CStyleBaseCodeGenerator::dispatch_schedule |
( |
| ) |
|
|
protectedpure virtual |
◆ dispatch_structures()
| void sdfg::codegen::CStyleBaseCodeGenerator::dispatch_structures |
( |
| ) |
|
|
protected |
◆ emit_capture_context_init()
| virtual void sdfg::codegen::CStyleBaseCodeGenerator::emit_capture_context_init |
( |
std::ostream & | ofs_source | ) |
const |
|
pure virtual |
◆ emit_header()
| bool sdfg::codegen::CStyleBaseCodeGenerator::emit_header |
( |
PrettyPrinter & | out | ) |
|
|
overridevirtual |
◆ emit_main_source()
| bool sdfg::codegen::CStyleBaseCodeGenerator::emit_main_source |
( |
std::ostream & | out, |
|
|
const std::filesystem::path & | header_path ) |
|
overridevirtual |
write the contents of the main source file into out.
Can also generate additional source files (snippets) that also depend on the header
Implements sdfg::codegen::CodeGenerator.
◆ generate()
| bool sdfg::codegen::CStyleBaseCodeGenerator::generate |
( |
| ) |
|
|
overridevirtual |
◆ language_extension()
| virtual LanguageExtension & sdfg::codegen::CStyleBaseCodeGenerator::language_extension |
( |
| ) |
|
|
protectedpure virtual |
The documentation for this class was generated from the following file: