docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
c_style_language_extension.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace sdfg {
6namespace codegen {
7
10public:
12
13 std::string comment(const std::string& text) override;
14
15 std::string assignment(const std::string& lhs, const std::string& rhs) override;
16
17 std::string local_declaration(const std::string& name, const types::IType& type, const std::string& init = "") override;
18
19 std::string copy_bytes(const std::string& dst, const std::string& src, const std::string& size) override;
20
21 std::string break_statement() override;
22
23 std::string continue_statement() override;
24
25 std::string return_statement(const std::string& value) override;
26
27 void deallocation(PrettyPrinter& stream, const std::string& container, const types::IType& type) override;
28
29 std::string null_literal() override;
30
31 std::string address_of(const std::string& expr) override;
32
33 std::string dereference(const std::string& expr) override;
34
35 std::string size_of(const std::string& expr) override;
36
37 std::string reinterpret_cast_expr(const std::string& expr, const std::string& type) override;
38
40 PrettyPrinter& stream, const structured_control_flow::StructuredLoop& loop, const LoopHints& hints
41 ) override;
42
43 Body begin_while(PrettyPrinter& stream) override;
44
45 Body begin_branch(PrettyPrinter& stream, size_t index, size_t count, const symbolic::Condition& condition) override;
46
47 Body begin_scope(PrettyPrinter& stream) override;
48
49 void end(PrettyPrinter& stream, const Body& body) override;
50
51protected:
53};
54
55} // namespace codegen
56} // namespace sdfg
Statement and control-flow syntax shared by the C family (C, C++, CUDA, HIP).
Definition c_style_language_extension.h:9
std::string continue_statement() override
std::string size_of(const std::string &expr) 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.
Body begin_scope(PrettyPrinter &stream) override
std::string null_literal() override
std::string dereference(const std::string &expr) override
std::string return_statement(const std::string &value) override
Body open(PrettyPrinter &stream, Body::Kind kind)
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.
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 break_statement() override
std::string assignment(const std::string &lhs, const std::string &rhs) override
LanguageExtension(sdfg::Function &function, const std::string &external_prefix)
Definition language_extension.h:45
std::string copy_bytes(const std::string &dst, const std::string &src, const std::string &size) override
std::string address_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
void end(PrettyPrinter &stream, const Body &body) override
std::string comment(const std::string &text) override
Body begin_while(PrettyPrinter &stream) override
An unconditional loop, left only through break or return.
LanguageExtension(sdfg::Function &function, const std::string &external_prefix)
Definition language_extension.h:45
Definition utils.h:16
Base class for structured loop constructs.
Definition structured_loop.h:244
Abstract base interface for all types in the sdfglib type system.
Definition type.h:625
SymEngine::RCP< const SymEngine::Boolean > Condition
Reference-counted pointer to a boolean condition expression.
Definition symbolic.h:86
Definition argument_registry.h:10
Definition analysis.h:7
An open region of emitted code, closed by LanguageExtension::end.
Definition language_extension.h:31
Kind
Block: the body of a control-flow construct. Scope: a lexical scope that only isolates local names.
Definition language_extension.h:33
Loop properties a language may be able to express (e.g. clang loop pragmas in C).
Definition language_extension.h:25