mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 08:47: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 "")))
|
(else "")))
|
||||||
(tdata-comma (if (> (string-length tdata) 0) "," ""))
|
(tdata-comma (if (> (string-length tdata) 0) "," ""))
|
||||||
(tptr-type (prim/c-var-pointer p))
|
(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 (cond
|
||||||
(tptr-type (mangle (gensym 'local)))
|
(tptr-type (mangle (gensym 'local)))
|
||||||
(else "")))
|
(else "")))
|
||||||
(tptr-decl
|
(tptr-decl
|
||||||
(cond
|
(cond
|
||||||
|
((and tptr-type use-alloca?) (string-append "object " tptr " = alloca(sizeof(" tptr-type ")); "))
|
||||||
(tptr-type (string-append tptr-type " " tptr "; "))
|
(tptr-type (string-append tptr-type " " tptr "; "))
|
||||||
(else "")))
|
(else "")))
|
||||||
(c-var-assign
|
(c-var-assign
|
||||||
|
|
Loading…
Add table
Reference in a new issue