Eliminate functionPointerFixups.json via auto-discovery heuristics#2246
Closed
jevansaks wants to merge 1 commit into
Closed
Eliminate functionPointerFixups.json via auto-discovery heuristics#2246jevansaks wants to merge 1 commit into
jevansaks wants to merge 1 commit into
Conversation
Add two new passes to RemapDiscovery.ResolveFunctionPointerFixups: - Pass 3: already-pointer typedefs with same-level aliases (10 entries) - Pass 4: bare function typedefs used as struct field pointers (12 entries) The remaining 4 header-inclusion-gap entries are already auto-discovered by partitions that include the relevant headers. Delete functionPointerFixups.json, PrepSettingsForFunctionPointerFixups, CreateRspsForFunctionPointerFixups.ps1, and all build wiring. Update docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5ebccd4 to
dc80312
Compare
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.
Summary
Eliminates
functionPointerFixups.jsonentirely by extending the scraper's auto-discovery heuristics inRemapDiscovery.csto handle all 27 remaining entries.New heuristic passes
Pass 3 — Same-level aliases (10 entries): For already-pointer function typedefs with exactly one same-level typedef alias (e.g.,
typedef DWORD (*PTHREAD_START_ROUTINE)(...); typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;), generates--remapand--exclude(no--reducePointerLevelsince no extra indirection).Pass 4 — Struct field callbacks (12 entries): Scans
RecordDeclfields for pointers to bare function typedefs (e.g.,QUERYFORCONNECTION *QueryForConnection;in LDAP structs,UCharIteratorGetIndex *getIndex;in ICU iterators). Generates--reducePointerLevelfor the typedef name.Header inclusion gaps (4 entries):
LSA_GET_EXTENDED_CALL_FLAGSand_WHEA_ERROR_SOURCE_*follow patterns the existing heuristic already handles — the JSON entries were masking auto-discovery.Deleted
generation/WinSDK/functionPointerFixups.json— all 27 manual entriessources/GeneratorSdk/MetadataTasks/PrepSettingsForFunctionPointerFixups.cs— MSBuild taskscripts/CreateRspsForFunctionPointerFixups.ps1— PowerShell helpersources/GeneratorSdk/samples/.../functionPointerFixups.json— sample copysdk.props,sdk.targets, andScrapeHeaders.csTests
52 unit tests pass (44 existing + 8 new). New tests cover same-level alias resolution, struct field scanning, edge cases (multiple aliases, exclude disambiguation, OldFontEnum pattern).
Risk
The 4 non-
alreadyPointerJSON entries (PBMCALLBACKFN,PTOP_LEVEL_EXCEPTION_FILTER,LPFNADDPROPSHEETPAGE,PFIBER_START_ROUTINE) previously generated--reducePointerLevelvia the JSON path. The new heuristic correctly omits it (they are same-level aliases, not pointer-adding). If the baseline winmd relied on that incorrectreducePointerLevel, CI will surface it.