This commit is contained in:
Ken McMillan 2018-06-29 12:10:21 -07:00
Родитель 961263e1fc
Коммит 7f83dccd56
2 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -100,7 +100,7 @@ module udp_impl(host,pkt,ser,des) = {
class udp_reader : public udp_task {
std::vector<char> buf;
public:
udp_reader(int my_id, int sock, const udp_callbacks &cb, ivy_class *ivy)
udp_reader(`host` my_id, int sock, const udp_callbacks &cb, ivy_class *ivy)
: udp_task(my_id, sock, cb, ivy) {
}

Просмотреть файл

@ -974,7 +974,7 @@ def create_thunk(impl,actname,action,classname):
params = [p for p in action.formal_params if p.name.startswith('prm:')]
inputs = [p for p in action.formal_params if not p.name.startswith('prm:')]
for p in params:
declare_symbol(impl,p)
declare_symbol(impl,p,classname=classname)
impl.append(' ')
emit_param_decls(impl,tc,params,extra = [ classname + ' *__ivy'],classname=classname)
impl.append(': __ivy(__ivy)' + ''.join(',' + varname(p) + '(' + varname(p) + ')' for p in params) + '{}\n')
@ -1178,6 +1178,8 @@ def check_iterable_sort(sort):
nt = native_type_full(im.module.native_types[sort.name]).strip()
if nt in ['int','bool','long long']:
return
if isinstance(sort,il.EnumeratedSort):
return
raise iu.IvyError(None,"cannot iterate over non-integer sort {}".format(sort))
@ -1189,6 +1191,10 @@ def open_loop(impl,vs,declare=True,bounds=None):
bds = bounds[num] if bounds else ["0",str(sort_card(idx.sort))]
vn = varname(idx.name)
ct = 'long long ' if ctype(idx.sort) == 'long long' else 'int '
if isinstance(idx.sort,il.EnumeratedSort):
ct = ctype(idx.sort)
impl.append('for ('+ ((ct + ' ') if declare else '') + vn + ' = (' + ct + ')' + bds[0] + '; (int) ' + vn + ' < ' + bds[1] + '; ' + vn + ' = (' + ct + ')(((int)' + vn + ') + 1)) {\n')
else:
impl.append('for ('+ (ct if declare else '') + vn + ' = ' + bds[0] + '; ' + vn + ' < ' + bds[1] + '; ' + vn + '++) {\n')
indent_level += 1