Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
3c0e946d
Commit
3c0e946d
authored
Jun 04, 2014
by
dbarbera
Browse files
Added basic process-level var generation
parent
e1b18b30
Changes
1
Hide whitespace changes
Inline
Side-by-side
LlvmGenerator.py
View file @
3c0e946d
...
...
@@ -93,9 +93,16 @@ def _process(process):
cons
=
core
.
Constant
.
int
(
core
.
Type
.
int
(),
len
(
LLVM
[
'states'
]))
LLVM
[
'states'
][
name
]
=
cons
#
Declare global
state var
#
Generate
state var
LLVM
[
'module'
].
add_global_variable
(
core
.
Type
.
int
(),
'state'
)
# Generare process-level vars
for
var_name
,
(
var_type
,
def_value
)
in
process
.
variables
.
viewitems
():
#TODO: Use ASN.1 type instead of hardcoded int type
var_ptr
=
LLVM
[
'module'
].
add_global_variable
(
core
.
Type
.
int
(),
str
(
var_name
))
if
def_value
:
pass
# Generate process functions
runtr_func
=
_generate_runtr_func
(
process
)
_generate_startup_func
(
process
,
process_name
,
runtr_func
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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