Skip to content

Commit

Permalink
cbuilder: ccgexprs sweep part 2 (#24392)
Browse files Browse the repository at this point in the history
follows up #24381

This is about another 30% of ccgexprs (remaining is up to around line
3000), stopped right before the point where #24391 is required.

The `Genode::log` and `Genode::Cstring` calls in `genEcho` are left as
is but could be mangled in the future.
  • Loading branch information
metagn authored Nov 1, 2024
1 parent 0e3330e commit c8072b1
Show file tree
Hide file tree
Showing 2 changed files with 384 additions and 227 deletions.
13 changes: 13 additions & 0 deletions compiler/cbuilderstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,16 @@ proc addReturn(builder: var Builder, value: string) =
builder.add("return ")
builder.add(value)
builder.add(";\n")

template addGoto(builder: var Builder, label: TLabel) =
builder.add("goto ")
builder.add(label)
builder.add(";\n")

template addIncr(builder: var Builder, val: Snippet) =
builder.add(val)
builder.add("++;\n")

template addDecr(builder: var Builder, val: Snippet) =
builder.add(val)
builder.add("--;\n")
Loading

0 comments on commit c8072b1

Please sign in to comment.