cl: ctx.logf/panicf - #873
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #873 +/- ##
==========================================
+ Coverage 85.33% 86.00% +0.66%
==========================================
Files 22 22
Lines 1821 1822 +1
==========================================
+ Hits 1554 1567 +13
+ Misses 267 255 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review — PR #873
Nice cleanup: routing skip/error diagnostics through pkgCtx.logf/panicf so they carry file:line positions is a clear improvement over bare log.Println, and adding clang.USR gives funcUSR a more reliable key than the display name. The Doxygen /** */ → // conversion in clang/clang.go and enabling TestLLVM_DenseMapInfo are safe.
A few items worth addressing, flagged inline:
panicfcan nil-deref —goNodereturnsnilforInvalidFilecursors, butpanicfcallsnode.Pos()/node.End()without a nil check (its siblinglogfis safe viagoNodePos). Reachable through theloadClassMemberdefault branch.- Two misleading skip messages — the
obj.order() >= 0overload case reuses the "unsupported template params" text, and the empty-mangling case reuses "with template arguments". - Leftover Doxygen
\cartifact in a converted comment.
Design note (not inline): several skip messages that were previously gated behind debugCompileDecl are now emitted unconditionally via ctx.logf. Each fires per skipped declaration and does real work (libclang Extent/Spelling cgo calls, fset.Position lookup, clang.String(...) allocation, and an unconditional stderr write). For large headers where many decls are skipped (symbol-not-found, template args, unsupported features), this changes default output verbosity and adds per-decl overhead that was previously zero. If surfacing skip reasons by default is intentional, this is fine — otherwise consider keeping them behind the debug flag. Flagging so it's a conscious choice.
No description provided.