mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 00:37:35 +02:00
Support alloca of basic arithmetic operations
This commit is contained in:
parent
be5a5f1c6b
commit
c10d38e170
1 changed files with 6 additions and 1 deletions
|
@ -692,12 +692,17 @@
|
|||
(else "")))
|
||||
(tdata-comma (if (> (string-length tdata) 0) "," ""))
|
||||
(tptr-type (prim/c-var-pointer p))
|
||||
(tptr-comma (if tptr-type ",&" ""))
|
||||
(tptr-comma
|
||||
(cond
|
||||
((and tptr-type use-alloca?) ",")
|
||||
(tptr-type ",&")
|
||||
(else "")))
|
||||
(tptr (cond
|
||||
(tptr-type (mangle (gensym 'local)))
|
||||
(else "")))
|
||||
(tptr-decl
|
||||
(cond
|
||||
((and tptr-type use-alloca?) (string-append "object " tptr " = alloca(sizeof(" tptr-type ")); "))
|
||||
(tptr-type (string-append tptr-type " " tptr "; "))
|
||||
(else "")))
|
||||
(c-var-assign
|
||||
|
|
Loading…
Add table
Reference in a new issue