@@ -581,6 +581,22 @@ skipped coverage in the summary.
581581* JS/native/wasm: prefer small, focused test files with
582582 ` -b js|native|wasm ` and ` -show-c-output ` where applicable; avoid
583583 broad ` -b <backend> test vlib/ ` .
584+ * Quick code location technique:
585+ When debugging code generation issues, add unique comment tags to
586+ relevant code generation points (e.g., ` /*tom51*/ ` ) in the compiler
587+ source. Rebuild and generate C code, then search the generated file for these
588+ tags to quickly map generated C code back to the exact compiler source
589+ location. This is especially useful when multiple code paths generate
590+ similar-looking output and you need to identify which path is actually used.
591+ Example:
592+ ``` v
593+ // In vlib/v/gen/c/assign.v:
594+ g.write('builtin___option_ok/*tom51*/(&(${styp}[]) { ')
595+
596+ // After rebuild, search generated C code for "tom51":
597+ // builtin___option_ok/*tom51*/(&(int[]) { ... });
598+ ```
599+ Remember to remove these debug tags after fixing the issue.
584600
585601## Compiler Architecture
586602The V compiler has the following stages, orchestrated by the
@@ -708,4 +724,4 @@ v.callgraph, etc.
708724 * New tests or test infra changes.
709725 * Output tests or ` .out ` updates.
710726 * Broad refactors or compiler-wide changes.
711- * Unsure which slow test runner applies to your change.
727+ * Unsure which slow test runner applies to your change.
0 commit comments