* declare end_function as an instruction, instead of a directive

git-svn-id: branches/wasm@46849 -
This commit is contained in:
nickysn 2020-09-11 16:25:44 +00:00
parent 5c27030faf
commit 5ee6e9d593
6 changed files with 6 additions and 12 deletions

View File

@ -407,9 +407,7 @@ interface
{ for the OMF object format }
asd_omf_linnum_line,
{ RISC-V }
asd_option,
{ WebAssembly }
asd_end_function
asd_option
);
TAsmSehDirective=(
@ -454,9 +452,7 @@ interface
{ for the OMF object format }
'omf_line',
{ RISC-V }
'option',
{ WebAssembly }
'end_function'
'option'
);
sehdirectivestr : array[TAsmSehDirective] of string[16]=(
'.seh_proc','.seh_endproc',

View File

@ -1811,8 +1811,6 @@ implementation
name has to be translated as well }
if dir=asd_cpu then
writer.AsmWrite(asminfo^.comment+' CPU ')
else if dir=asd_end_function then
writer.AsmWrite(#9#9+directivestr[dir])
else
writer.AsmWrite('.'+directivestr[dir]+' ');
end;

View File

@ -40,7 +40,7 @@ uses
TAsmOp=(A_None,
// control flow
a_block, a_loop, a_br, a_br_if, a_br_table, a_if, a_else, a_end_block,
a_end_loop, a_end_if, a_return, a_unreachable,
a_end_loop, a_end_if, a_end_function, a_return, a_unreachable,
// basic
a_nop, a_drop, a_i32_const, a_i64_const, a_f32_const, a_f64_const,
a_get_local, a_set_local, a_tee_local, a_get_global, a_set_global,

View File

@ -1707,7 +1707,7 @@ implementation
list.Concat(taicpu.op_sym(a_set_global,current_asmdata.RefAsmSymbol(STACK_POINTER_SYM,AT_LABEL)));
list.concat(taicpu.op_none(a_return));
list.concat(tai_directive.Create(asd_end_function,''));
list.concat(taicpu.op_none(a_end_function));
end;
procedure thlcgwasm.gen_load_return_value(list: TAsmList);

View File

@ -39,7 +39,7 @@ interface
'<none>',
// control flow
'block', 'loop', 'br', 'br_if', 'br_table', 'if', 'else', 'end_block',
'end_loop', 'end_if', 'return', 'unreachable',
'end_loop', 'end_if', 'end_function', 'return', 'unreachable',
// basic
'nop', 'drop', 'i32.const', 'i64.const', 'f32.const', 'f64.const',
'local.get', 'local.set', 'local.tee', 'global.get', 'global.set',

View File

@ -22,7 +22,7 @@
'<none>',
// control flow
'block', 'loop', 'br', 'br_if', 'br_table', 'if', 'else', 'end', 'end', 'end',
'block', 'loop', 'br', 'br_if', 'br_table', 'if', 'else', 'end', 'end', 'end', '',
'return', 'unreachable',
// basic
'nop', 'drop', 'i32.const', 'i64.const', 'f32.const', 'f64.const',