fix(tool): support path helpers for call rules#482
Conversation
Add path parsing and helper file materialization for call rules so wrapper replacements can reference helper functions outside the target source file. Assisted-by: ChatGPT 5
|
|
|
Thank you for the contribution. We already support helper usage through the existing |
|
That makes sense to me. I agree that broadening For call rules specifically, it seems cleaner to reference helpers through an imported package alias in So I think the better fix may be limited to golden-test infrastructure: either teach |
Description
Adds
pathsupport to call rules so replacement wrappers can reference helper functions that live outside the target source file.This change:
Pathparsing toInstCallRulereplace/append_argspathinto the target package during instrumentationwrap_sizeof_callandwrap_sizeof_with_stringspathbehaviorMotivation
Call-rule YAML fixtures can specify wrapper expressions such as
Wrapper({{ . }}), butInstCallRulepreviously had noPathfield. As a result, addingpath:to YAML would be silently ignored, and call-rule replacements could only reference helpers already defined in the target source file or symbols available through imports.This fixes the missing code path so helper functions can be located and compiled into the target package when a call rule needs them.
Fixes #
Checklist
make formatmake lintmake test