Commit ce575534

ce5755346930Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 1 file · ~1 modified

Description

Name the method in unsupported-CallNode diagnostics

The "unsupported call/puts argument/..." errors printed only the node id and node type. For a CallNode, also print the method name so triage can cluster failures by the missing method without dumping the AST.

Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]

Details

Commit
ce5755346930
Parent
8505715f8e0f

src/codegen.cmodifiedView file

@@ -136,8 +136,13 @@
136136
137137 static void unsupported(Compiler *c, int id, const char *what) {
138138 const char *ty = nt_type(c->nt, id);
139- fprintf(stderr, "spinelc: unsupported %s: node %d (%s)\n",
140- what, id, ty ? ty : "?");
139+ const char *mname = ty && !strcmp(ty, "CallNode") ? nt_str(c->nt, id, "name") : NULL;
140+ if (mname)
141+ fprintf(stderr, "spinelc: unsupported %s: node %d (%s `%s`)\n",
142+ what, id, ty, mname);
143+ else
144+ fprintf(stderr, "spinelc: unsupported %s: node %d (%s)\n",
145+ what, id, ty ? ty : "?");
141146 exit(1);
142147 }
143148