Skip to content

fix(extraction): broaden the curated C++ inline-macro library list#1103

Merged
colbymchenry merged 2 commits into
mainfrom
fix/cpp-more-inline-macro-libraries
Jul 1, 2026
Merged

fix(extraction): broaden the curated C++ inline-macro library list#1103
colbymchenry merged 2 commits into
mainfrom
fix/cpp-more-inline-macro-libraries

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

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

  • Mozilla/SpiderMonkey: MOZ_ALWAYS_INLINE, MOZ_NEVER_INLINE
  • Protobuf: PROTOBUF_ALWAYS_INLINE, PROTOBUF_NOINLINE
  • {fmt}/spdlog: FMT_CONSTEXPR20, FMT_CONSTEXPR, FMT_INLINE
  • Hedley + nlohmann/json: HEDLEY_ALWAYS_INLINE/HEDLEY_NEVER_INLINE, JSON_HEDLEY_ALWAYS_INLINE/JSON_HEDLEY_NEVER_INLINE
  • GLM (graphics math): GLM_FUNC_QUALIFIER, GLM_FUNC_DECL, GLM_CONSTEXPR, GLM_INLINE
  • Bullet / Skia / OpenCV / EASTL / Cocos2d-x / Chromium-WebKit: SIMD_FORCE_INLINE, SK_ALWAYS_INLINE, CV_ALWAYS_INLINE/CV_INLINE, EA_FORCE_INLINE/EA_NOINLINE, CC_INLINE, NEVER_INLINE
  • C libraries: G_INLINE_FUNC (GLib), SQLITE_PRIVATE/SQLITE_API
  • Windows calling conventions: WINAPI, 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

  • 11 representative libraries tested end-to-end for full name+return-type recovery (Mozilla, GLM, Bullet, OpenCV, Skia, EASTL, protobuf, fmt, Hedley, and the Windows conventions).
  • CARLA control unchanged: 440→6 mangles, 0 regressions (none of these libraries appear there, confirming the larger list adds no collateral).
  • Full suite green (1881 passed).

🤖 Generated with Claude Code

colbymchenry and others added 2 commits July 1, 2026 09:42
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>
)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@colbymchenry colbymchenry merged commit 0076520 into main Jul 1, 2026
1 check passed
@colbymchenry colbymchenry deleted the fix/cpp-more-inline-macro-libraries branch July 1, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant