docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::codegen::CStyleLanguageExtension Class Reference

Statement and control-flow syntax shared by the C family (C, C++, CUDA, HIP). More...

#include <sdfg/codegen/language_extensions/c_style_language_extension.h>

Inheritance diagram for sdfg::codegen::CStyleLanguageExtension:
[legend]

Public Member Functions

std::string comment (const std::string &text) override
std::string assignment (const std::string &lhs, const std::string &rhs) override
std::string local_declaration (const std::string &name, const types::IType &type, const std::string &init="") override
 Declares a local, initialized if init is non-empty. Empty if the language needs no declaration.
std::string copy_bytes (const std::string &dst, const std::string &src, const std::string &size) override
std::string break_statement () override
std::string continue_statement () override
std::string return_statement (const std::string &value) override
void deallocation (PrettyPrinter &stream, const std::string &container, const types::IType &type) override
 Emits the release of a container the function owns, if its storage requires one.
std::string null_literal () override
std::string address_of (const std::string &expr) override
std::string dereference (const std::string &expr) override
std::string size_of (const std::string &expr) override
std::string reinterpret_cast_expr (const std::string &expr, const std::string &type) override
Body begin_for (PrettyPrinter &stream, const structured_control_flow::StructuredLoop &loop, const LoopHints &hints) override
Body begin_while (PrettyPrinter &stream) override
 An unconditional loop, left only through break or return.
Body begin_branch (PrettyPrinter &stream, size_t index, size_t count, const symbolic::Condition &condition) override
 Branch index of count branches of a conditional, guarded by condition.
Body begin_scope (PrettyPrinter &stream) override
void end (PrettyPrinter &stream, const Body &body) override
 LanguageExtension (sdfg::Function &function, const std::string &external_prefix)
Public Member Functions inherited from sdfg::codegen::LanguageExtension
 LanguageExtension (sdfg::Function &function, const std::string &external_prefix)
virtual ~LanguageExtension ()=default
const std::string & external_prefix () const
virtual const std::string language () const =0
virtual std::string primitive_type (const types::PrimitiveType prim_type)=0
virtual std::string declaration (const std::string &name, const types::IType &type, bool use_initializer=false, bool use_alignment=false)=0
virtual std::string type_cast (const std::string &name, const types::IType &type)=0
virtual std::string subset (const types::IType &type, const data_flow::Subset &subset)=0
virtual std::string expression (const symbolic::Expression expr)=0
virtual std::string access_node (const data_flow::AccessNode &node)=0
virtual std::string tasklet (const data_flow::Tasklet &tasklet)=0
virtual std::string zero (const types::PrimitiveType prim_type)=0

Protected Member Functions

Body open (PrettyPrinter &stream, Body::Kind kind)

Additional Inherited Members

Protected Attributes inherited from sdfg::codegen::LanguageExtension
sdfg::Function & function_
std::string external_prefix_

Detailed Description

Statement and control-flow syntax shared by the C family (C, C++, CUDA, HIP).

Member Function Documentation

◆ address_of()

std::string sdfg::codegen::CStyleLanguageExtension::address_of ( const std::string & expr)
overridevirtual

◆ assignment()

std::string sdfg::codegen::CStyleLanguageExtension::assignment ( const std::string & lhs,
const std::string & rhs )
overridevirtual

◆ begin_branch()

Body sdfg::codegen::CStyleLanguageExtension::begin_branch ( PrettyPrinter & stream,
size_t index,
size_t count,
const symbolic::Condition & condition )
overridevirtual

Branch index of count branches of a conditional, guarded by condition.

Implements sdfg::codegen::LanguageExtension.

◆ begin_for()

Body sdfg::codegen::CStyleLanguageExtension::begin_for ( PrettyPrinter & stream,
const structured_control_flow::StructuredLoop & loop,
const LoopHints & hints )
overridevirtual

◆ begin_scope()

Body sdfg::codegen::CStyleLanguageExtension::begin_scope ( PrettyPrinter & stream)
overridevirtual

◆ begin_while()

Body sdfg::codegen::CStyleLanguageExtension::begin_while ( PrettyPrinter & stream)
overridevirtual

An unconditional loop, left only through break or return.

Implements sdfg::codegen::LanguageExtension.

◆ break_statement()

std::string sdfg::codegen::CStyleLanguageExtension::break_statement ( )
overridevirtual

◆ comment()

std::string sdfg::codegen::CStyleLanguageExtension::comment ( const std::string & text)
overridevirtual

◆ continue_statement()

std::string sdfg::codegen::CStyleLanguageExtension::continue_statement ( )
overridevirtual

◆ copy_bytes()

std::string sdfg::codegen::CStyleLanguageExtension::copy_bytes ( const std::string & dst,
const std::string & src,
const std::string & size )
overridevirtual

◆ deallocation()

void sdfg::codegen::CStyleLanguageExtension::deallocation ( PrettyPrinter & stream,
const std::string & container,
const types::IType & type )
overridevirtual

Emits the release of a container the function owns, if its storage requires one.

Implements sdfg::codegen::LanguageExtension.

◆ dereference()

std::string sdfg::codegen::CStyleLanguageExtension::dereference ( const std::string & expr)
overridevirtual

◆ end()

void sdfg::codegen::CStyleLanguageExtension::end ( PrettyPrinter & stream,
const Body & body )
overridevirtual

◆ LanguageExtension()

sdfg::codegen::LanguageExtension::LanguageExtension ( sdfg::Function & function,
const std::string & external_prefix )
inline

◆ local_declaration()

std::string sdfg::codegen::CStyleLanguageExtension::local_declaration ( const std::string & name,
const types::IType & type,
const std::string & init = "" )
overridevirtual

Declares a local, initialized if init is non-empty. Empty if the language needs no declaration.

Implements sdfg::codegen::LanguageExtension.

◆ null_literal()

std::string sdfg::codegen::CStyleLanguageExtension::null_literal ( )
overridevirtual

◆ open()

Body sdfg::codegen::CStyleLanguageExtension::open ( PrettyPrinter & stream,
Body::Kind kind )
protected

◆ reinterpret_cast_expr()

std::string sdfg::codegen::CStyleLanguageExtension::reinterpret_cast_expr ( const std::string & expr,
const std::string & type )
overridevirtual

◆ return_statement()

std::string sdfg::codegen::CStyleLanguageExtension::return_statement ( const std::string & value)
overridevirtual

◆ size_of()

std::string sdfg::codegen::CStyleLanguageExtension::size_of ( const std::string & expr)
overridevirtual

The documentation for this class was generated from the following file: