fix(extraction): broaden the curated C++ inline-macro library list#1103
Merged
Conversation
Since #1102 the post-parse salvage already recovers the NAME for any macro, so adding a library now buys full return-type recovery for it. Extend the curated list across the major C++ ecosystem: Mozilla/SpiderMonkey, Protobuf, {fmt}, Hedley + nlohmann/json, GLM, Bullet (SIMD_FORCE_INLINE), Skia, OpenCV, EASTL, Cocos2d-x, Chromium/WebKit (NEVER_INLINE), GLib, SQLite, and the unambiguous Windows calling conventions (WINAPI / APIENTRY / STDMETHODCALLTYPE / WINAPIV — which sit between the return type and the name, so blanking them recovers the return type, e.g. `HRESULT WINAPI Foo()` -> Foo : HRESULT). Every entry is an exact, curated token matched only in specifier position, so a real all-caps return type is never touched. Anything still missed keeps its name via the universal salvage. CARLA control unchanged (440->6 mangles, 0 regressions — none of these libs appear there, confirming no collateral). Eleven representative full-recovery tests added. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Follow-up to #1102. The universal post-parse salvage already recovers the name for any macro (known or not), so adding a library to the curated list now buys full return-type recovery for it. This broadens that curated coverage across the major C++ ecosystem, out of the gate.
Added
MOZ_ALWAYS_INLINE,MOZ_NEVER_INLINEPROTOBUF_ALWAYS_INLINE,PROTOBUF_NOINLINEFMT_CONSTEXPR20,FMT_CONSTEXPR,FMT_INLINEHEDLEY_ALWAYS_INLINE/HEDLEY_NEVER_INLINE,JSON_HEDLEY_ALWAYS_INLINE/JSON_HEDLEY_NEVER_INLINEGLM_FUNC_QUALIFIER,GLM_FUNC_DECL,GLM_CONSTEXPR,GLM_INLINESIMD_FORCE_INLINE,SK_ALWAYS_INLINE,CV_ALWAYS_INLINE/CV_INLINE,EA_FORCE_INLINE/EA_NOINLINE,CC_INLINE,NEVER_INLINEG_INLINE_FUNC(GLib),SQLITE_PRIVATE/SQLITE_APIWINAPI,WINAPIV,APIENTRY,STDMETHODCALLTYPE— these sit between the return type and the name, so blanking them recovers the return type:HRESULT WINAPI Foo()→Foo:HRESULT.Safety
Every entry is an exact, curated token matched only in specifier position (
\b(TOKEN)\b(?=\s+[A-Za-z_])), so a real all-caps return type (HRESULT DoIt()) is never blanked. I deliberately left out short/word-like tokens (SI,CALLBACK,PASCAL) — those would be collision-prone, and the salvage recovers their names anyway. Anything not listed still gets its name via the universal salvage from #1102.Validation
🤖 Generated with Claude Code