Skip to content

Commit d785011

Browse files
authored
cgen: cleanup unneeded marker comments (#23152)
1 parent c941c3d commit d785011

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

vlib/v/gen/c/cgen.v

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,8 @@ pub fn (mut g Gen) write_typeof_functions() {
10681068
if sum_info.is_generic {
10691069
continue
10701070
}
1071-
g.writeln('/*C1*/${static_prefix}char * v_typeof_sumtype_${sym.cname}(int sidx) {')
1072-
g.definitions.writeln('/*C1*/${static_prefix}char * v_typeof_sumtype_${sym.cname}(int);')
1071+
g.writeln('${static_prefix}char * v_typeof_sumtype_${sym.cname}(int sidx) {')
1072+
g.definitions.writeln('${static_prefix}char * v_typeof_sumtype_${sym.cname}(int);')
10731073
if g.pref.build_mode == .build_module {
10741074
g.writeln('\t\tif( sidx == _v_type_idx_${sym.cname}() ) return "${util.strip_main_name(sym.name)}";')
10751075
for v in sum_info.variants {
@@ -2554,7 +2554,7 @@ fn (mut g Gen) get_sumtype_casting_fn(got_ ast.Type, exp_ ast.Type) string {
25542554
}
25552555
g.sumtype_definitions[i] = true
25562556
g.sumtype_casting_fns << SumtypeCastingFn{
2557-
fn_name: fn_name + '/*ISEE*/'
2557+
fn_name: fn_name
25582558
got: if got_.has_flag(.option) {
25592559
new_got := ast.idx_to_type(got_sym.idx).set_flag(.option)
25602560
new_got
@@ -2785,7 +2785,7 @@ fn (mut g Gen) expr_with_cast(expr ast.Expr, got_type_raw ast.Type, expected_typ
27852785
// Do not allocate for `Interface(unsafe{nil})` casts
27862786
is_nil_cast := expr is ast.UnsafeExpr && expr.expr is ast.Nil
27872787
if is_nil_cast {
2788-
g.write2('/*nil*/', '((void*)0)')
2788+
g.write('((void*)0)')
27892789
return
27902790
}
27912791
}
@@ -2842,9 +2842,7 @@ fn (mut g Gen) expr_with_cast(expr ast.Expr, got_type_raw ast.Type, expected_typ
28422842
unwrapped_got_sym = g.table.sym(unwrapped_got_type)
28432843
}
28442844

2845-
fname := g.get_sumtype_casting_fn(unwrapped_got_type, unwrapped_expected_type) +
2846-
'/*Q*/'
2847-
2845+
fname := g.get_sumtype_casting_fn(unwrapped_got_type, unwrapped_expected_type)
28482846
if expr is ast.ArrayInit && got_sym.kind == .array_fixed {
28492847
stmt_str := g.go_before_last_stmt().trim_space()
28502848
g.empty_line = true
@@ -3224,7 +3222,7 @@ fn (mut g Gen) gen_clone_assignment(var_type ast.Type, val ast.Expr, typ ast.Typ
32243222
is_sumtype := g.table.type_kind(var_type) == .sum_type
32253223
if is_sumtype {
32263224
variant_typ := g.styp(typ).replace('*', '')
3227-
fn_name := g.get_sumtype_casting_fn(typ, var_type) + '/*L*/'
3225+
fn_name := g.get_sumtype_casting_fn(typ, var_type)
32283226
g.write('${fn_name}(ADDR(${variant_typ}, array_clone_static_to_depth(')
32293227
if typ.is_ptr() {
32303228
g.write('*')

vlib/v/gen/c/fn.v

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,13 +677,12 @@ fn (mut g Gen) gen_anon_fn_decl(mut node ast.AnonFn) {
677677
}
678678
node.has_gen[fn_name] = true
679679
mut builder := strings.new_builder(256)
680-
// builder.writeln('/*F1*/')
681680
// Generate a closure struct
682681
if node.inherited_vars.len > 0 {
683682
ctx_struct := g.closure_ctx(node.decl)
684683
if ctx_struct !in g.closure_structs {
685684
g.closure_structs << ctx_struct
686-
g.definitions.writeln('/*HALLO*/${ctx_struct} {')
685+
g.definitions.writeln('${ctx_struct} {')
687686
for var in node.inherited_vars {
688687
var_sym := g.table.sym(var.typ)
689688
if var_sym.info is ast.FnType {
@@ -703,9 +702,7 @@ fn (mut g Gen) gen_anon_fn_decl(mut node ast.AnonFn) {
703702
g.anon_fn = true
704703
g.fn_decl(node.decl)
705704
g.anon_fn = was_anon_fn
706-
// builder.write_string('/*LOL*/')
707705
builder.write_string(g.out.cut_to(pos))
708-
// builder.writeln('/*F2*/')
709706
out := builder.str()
710707
g.anon_fn_definitions << out
711708
if g.pref.parallel_cc {

0 commit comments

Comments
 (0)