cl refactor: add preload stage - #893
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #893 +/- ##
==========================================
- Coverage 87.64% 86.84% -0.80%
==========================================
Files 23 24 +1
Lines 1991 2015 +24
==========================================
+ Hits 1745 1750 +5
- Misses 246 265 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 2, 2026
fennoai Bot
pushed a commit
that referenced
this pull request
Oct 3, 2026
…ups (#894) The real cause of the hang (not the class-body re-init theory from the earlier commits, which are reverted here): the #893 refactor merged function and class-template overloads into a single overloads.items list, and overloads.reorder() now sorts the whole group with a comparator meant only for function overloads. For a class template and its partial specializations (which share one C/C++ name, e.g. llvm::DenseMapInfo and its 6 specializations), the clang cursor is not a function, so NumArguments() returns -1. That -1 was fed into 'for k := range c.Uint(na)', and c.Uint(-1) wraps to ~4,294,967,295, so each comparison spun ~4.3 billion iterations calling Argument(k).Type() on out-of-range indices -- effectively an infinite hang on the LLVM ADT fixtures (DenseMapInfo, STLForwardCompat) that carry such specialization groups. Pre-refactor this never happened because reorder() sorted only the function list (p.fns). Fix: clamp a negative NumArguments() to 0 so non-function cursors are treated as argument-less and skip the argument comparison, keeping the existing ordering for real function overloads byte-for-byte. Reproduced and verified end-to-end with llgo + clang-22.1.8: TestLLVM_DenseMapInfo and TestLLVM_STLForwardCompat now complete in <1s (previously hung) and the full tool LLVM suite passes. The STLForwardCompat golden out.go is updated to the deterministic source-order output the three-stage pipeline now emits. Reverts the ineffective initClassType guards from the previous two commits on this branch.
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.
No description provided.