fix(parsing): recover export-macro-hidden type definitions (#1989) - #2005
fix(parsing): recover export-macro-hidden type definitions (#1989)#2005XIYBHK wants to merge 1 commit into
Conversation
…1989) Collect a bounded set of conventional export macro candidates and inject empty definitions into the existing C/C++ preprocessing second pass without overriding explicit caller definitions. Conservatively reconcile remapped definitions to recover hidden classes, structs, enums, free functions, and inline methods while suppressing matching base-class phantom callables. Add focused regression coverage for supported suffixes, ordinary all-caps negative controls, candidate limits, comments, strings, raw strings, overlong names, explicit define priority, and C/C++ extraction. Local MinGW extraction tests pass (344/344). ASan/UBSan were not available in the local MinGW toolchain and remain covered by upstream CI. Signed-off-by: XIYBHK <xiybhk@163.com>
|
Holding note, because you are owed one before any review verdict. On #1989 you asked two direct questions:
Nobody answered. You did the right thing by asking, waited, and then built it anyway rather than letting the report rot — but this PR's description calls it "the agreed option 1", and I want to be straight with you: it was never agreed, because we never replied. That is our failure, not a liberty you took. I have put the direction question — heuristic shape versus config-driven defines versus both — in front of the maintainer now, and I will bring you a real answer rather than letting it sit again. Two things I can say already, having read the diff rather than the summary: The report is exemplary. Naming UBT's And the implementation is careful in the places that are easy to get wrong. None of that decides the direction question, which is genuinely the maintainer's. But it does mean that if the answer is yes, this is in good shape. Thank you for the patience, and sorry it took a PR to get a reply. |
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thanks for the clarification. I may be interpreting the timeline differently, so I checked the issue history. Before opening this PR, I asked whether to pursue the heuristic option 1 or the config-driven option 2, and whether to combine them. The reply on #1989 explicitly asked me to "open a focused PR for option 1 only" and specified the candidate cap, negative controls, no user-configured define plumbing, and the class/struct/enum/free-function test boundary: #1989 (comment) I used that as the scope for this PR. I agree that the exact regex was not approved character-for-character; the implementation made the candidate filter deliberately conservative and bounded. If the exact filter or any other part of the scope should change, I am happy to adjust it. I just wanted to clarify that the option-1 direction and scope were discussed in the issue before implementation. |
What does this PR do?
Fixes #1989
This PR implements the agreed option 1 for export-macro-hidden C/C++ definitions. It collects a bounded set of conventional export-macro candidates, injects empty
NAME=definitions into the existing preprocessing second pass, and preserves explicitly configured defines.The extraction reconciliation is deliberately conservative: remapped definitions must pass line mapping, original-line visibility, and qualified-name deduplication gates. It recovers hidden class/struct/enum definitions, free functions, and inline methods, while suppressing only base-class phantom callables and preserving ordinary all-caps identifiers.
Candidate scanning is bounded to 32 names per file and skips comments, strings, character literals, line-spliced comments, and C++ raw strings. No user-configured define plumbing, version changes, Makefile changes, or unrelated files are included.
Validation
git diff --cached --checkandgit-clang-format --diff --stagedis clean.Signed-off-bytrailer.cppcheckexecutable and three pre-existing clang-format violations outside this PR's four files.Known boundaries are unchanged: one-character export prefixes such as
X_APIare intentionally rejected, header-only prototypes without a definition remain governed by the existing extractor behavior, and UINTERFACE cascade handling is deferred to a follow-up issue.