Skip to content

ltoplugin: analyze MethodByName names through bounded loops#2126

Merged
xushiwei merged 4 commits into
xgo-dev:mainfrom
zhouguangyuan0718:main-lto-string-loop
Jul 20, 2026
Merged

ltoplugin: analyze MethodByName names through bounded loops#2126
xushiwei merged 4 commits into
xgo-dev:mainfrom
zhouguangyuan0718:main-lto-string-loop

Conversation

@zhouguangyuan0718

@zhouguangyuan0718 zhouguangyuan0718 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • analyze MethodByName names loaded through bounded loop indices, including direct range values
  • recover names from constant string arrays and local array literals lowered to alloca/store/load sequences
  • keep the analysis conservative when local memory has unknown writes or escapes
  • cover loop, caller-parameter propagation, and [...]string{const...} range cases in the LTO tests

The local composite literal case was not handled before because ABI lowering produced a local string array initialized by constant stores, while the pass only folded loads from global initializers.

Validation

  • full TestBuildAndCheckSymbolsFromTestltoLTOPlugin
  • full TestRunAndTestFromTestltoLTOPlugin

Both pass with the rebuilt LTO plugin, and the new test confirms that Query, Mutation, and Subscription are retained while Drop is eliminated.

@zhouguangyuan0718
zhouguangyuan0718 marked this pull request as ready for review July 19, 2026 11:25
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zhouguangyuan0718
zhouguangyuan0718 marked this pull request as draft July 19, 2026 12:07
@zhouguangyuan0718
zhouguangyuan0718 marked this pull request as ready for review July 19, 2026 23:08
@xushiwei
xushiwei merged commit 0d338c7 into xgo-dev:main Jul 20, 2026
42 checks passed
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.

2 participants