cgen: minor cleanup in go_expr() (#13801)

pull/13802/head
yuyi 2022-03-22 18:07:46 +08:00 committed by GitHub
parent 56f5ed4789
commit a9837ba95d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -5156,7 +5156,8 @@ fn (mut g Gen) go_expr(node ast.GoExpr) {
panic('cgen: obf name "$key" not found, this should never happen') panic('cgen: obf name "$key" not found, this should never happen')
} }
} }
g.writeln('// go') g.empty_line = true
g.writeln('// start go')
wrapper_struct_name := 'thread_arg_' + name wrapper_struct_name := 'thread_arg_' + name
wrapper_fn_name := name + '_thread_wrapper' wrapper_fn_name := name + '_thread_wrapper'
arg_tmp_var := 'arg_' + tmp arg_tmp_var := 'arg_' + tmp
@ -5214,7 +5215,7 @@ fn (mut g Gen) go_expr(node ast.GoExpr) {
g.writeln('pthread_detach(thread_$tmp);') g.writeln('pthread_detach(thread_$tmp);')
} }
} }
g.writeln('// endgo\n') g.writeln('// end go')
if node.is_expr { if node.is_expr {
handle = 'thread_$tmp' handle = 'thread_$tmp'
// create wait handler for this return type if none exists // create wait handler for this return type if none exists