Skip to content

Revert "Revert "cl refactor: add preload stage"" - #901

Merged
xushiwei merged 1 commit into
mainfrom
revert-895-revert-893-q
Oct 3, 2026
Merged

xushiwei merged 1 commit into
mainfrom
revert-895-revert-893-q

Conversation

@xushiwei

@xushiwei xushiwei commented Oct 3, 2026

Copy link
Copy Markdown
Member

Reverts #895

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.89320% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.54%. Comparing base (7dfb6ab) to head (e9000d0).

Files with missing lines Patch % Lines
cl/preload.go 87.83% 18 Missing ⚠️
cl/class.go 70.37% 8 Missing ⚠️
cl/type.go 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #901      +/-   ##
==========================================
- Coverage   89.38%   88.54%   -0.85%     
==========================================
  Files          20       21       +1     
  Lines        1922     1946      +24     
==========================================
+ Hits         1718     1723       +5     
- Misses        204      223      +19     
Flag Coverage Δ
llgo-tests 88.54% <86.89%> (-0.85%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: re-apply class/function loading refactor

This PR re-applies the two-phase load refactor in cl/ (unifying funcObj/templateClass into overloadObj, splitting preload/load/compile phases via the new cl/preload.go). The build passes (go build ./cl/...) and the refactor logic reads soundly: newClassCtx nil handling is correctly guarded in loadClass/loadTemplateClass, the two-queue compile() flow runs each unit once, and preloadClass's NumTemplateArguments() >= 0 check is correct (-1 = not a template).

Main findings are inline. In short:

  • addOveerloadObj is misspelled (double "e") across its definition, 4 call sites, and the debug log string in a brand-new file — worth fixing now before it gets entrenched.
  • Two LLVM tests were silently disabled by renaming to _Test..., one with a leftover debug log.Println. No comment or tracking reason; t.Skip("reason") would keep the skip visible.
  • A bare panic on a nested partial specialization (cl/class.go:352) replaces the previous graceful handling — a valid-but-unsupported C++ construct now hard-crashes the generator with no source location.

Non-blocking observations:

  • Performance: newClassCtx adds a second clang.VisitChildren pass over each class's members (the first being initClassTypeEx, where loadClassMember is now a no-op for methods). This appears intentional — method USRs must be preloaded before out-of-line definitions resolve in loadOutsideMethod — but it does double the per-class child walk; worth confirming it's needed for classes with no out-of-line methods.
  • Docs: cl/class.go removed the "class name acts like a namespace" rationale comments on the static-VarDecl and nested-class branches, which leaves the "same reason as a named nested class/struct above" cross-reference on the nested-union branch dangling. Also, compileFuncOrMethod's doc still describes a cls parameter that is now named this.

Comment thread cl/preload.go
Comment thread cl/preload.go
Comment thread cl/class.go
Comment thread tool/gen_test.go
}

func TestLLVM_DenseMapInfo(t *testing.T) {
func _TestLLVM_DenseMapInfo(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming to _TestLLVM_DenseMapInfo removes this from the Go test runner with no compile/lint signal and no explanation — coverage is lost invisibly. If intentional, add a comment/tracking issue, or use t.Skip("reason") so the skip is visible in test output.

Comment thread tool/gen_test.go
Comment thread tool/gen_test.go
@xushiwei
xushiwei merged commit fe97e52 into main Oct 3, 2026
4 of 6 checks passed
@xushiwei
xushiwei deleted the revert-895-revert-893-q branch October 3, 2026 02:45
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