Build Singeli files with a filename prefix

This commit is contained in:
Marshall Lochbaum 2022-09-30 11:35:25 -04:00
parent cad566d547
commit 47cdf02877
2 changed files with 3 additions and 2 deletions

View File

@ -9,9 +9,10 @@ srcfile ← •file.At srcfileR
resfile •file.At resfileR
tmpfile (•file.At buildDir) •file.At filename".d.orig"
depfile (•file.At buildDir) •file.At filename".d"
prefix "si_" (`'.')/ •file.Name srcfile
# invoke singeli, which creates the result file
("-d" tmpfile "-o" resfile srcfile) •Import siDir •file.At "singeli"
("-d" tmpfile "-o" resfile "-n" prefix srcfile) •Import siDir •file.At "singeli"
# output dependency file
deps siDir•file.At¨ •file.Lines tmpfile

View File

@ -19,7 +19,7 @@ def bit {k,x} = x & (1<<k) # get the k-th bit
def rare{x:u1} = emit{u1, '__builtin_expect', x, 0}
def assert{x & x==0} = assert{'failed assertion'}
def assert{x & x==1} = 1
def assert{x:u1} = emit{void, 'si_assert', x}
def assert{x:u1} = { if (not x) emit{void, '__builtin_unreachable'} }
# various checks