Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Plewinski
pystencils
Commits
a4b64edf
Commit
a4b64edf
authored
Sep 22, 2019
by
Stephan Seitz
Browse files
llvm: Implement LLVMPrinter._print_Conditional
parent
803bca2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/llvm/llvm.py
View file @
a4b64edf
...
...
@@ -302,8 +302,16 @@ class LLVMPrinter(Printer):
phi
.
add_incoming
(
val
,
block
)
return
phi
# Should have a list of math library functions to validate this.
# TODO function calls to libs
def
_print_Conditional
(
self
,
node
):
cond
=
self
.
_print
(
node
.
condition_expr
)
with
self
.
builder
.
if_else
(
cond
)
as
(
then
,
otherwise
):
with
then
:
self
.
_print
(
node
.
true_block
)
# emit instructions for when the predicate is true
with
otherwise
:
self
.
_print
(
node
.
false_block
)
# emit instructions for when the predicate is true
# No return!
def
_print_Function
(
self
,
expr
):
name
=
expr
.
func
.
__name__
e0
=
self
.
_print
(
expr
.
args
[
0
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment