Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix unsafe.Sizeof for llgo:type C #524

Merged
merged 1 commit into from
Jul 17, 2024
Merged

Conversation

visualfc
Copy link
Member

@visualfc visualfc commented Jul 16, 2024

unsafe.Sizeof 在 types.check 中转换为整数值,所以在 types.check 之前预先分析 []*ast.File 查找 llgo:type C 标志,用来判断 prog.TypesSize.Sizeof 和 prog.gocvt.cvtType 。

  • internal/packages
    func (Deduper).SetPreload(fn func(pkg *types.Package, syntax []*ast.File))
    func (Deduper).SetPkgPath(fn func(path, name string) string)
  • internal/build
    deduper.SetPreload for check llgo:type C before types.check
  • ssa
    (Program).SetTypeBackground(fullName string, bg Background)
    use the goTypes.typbg map for types.Sizes and goTypes.cvtType
  • internal/llgen
    use internal/packages.Deduper.SetPkgPath for custome pkgPath.

Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.72%. Comparing base (21a2f71) to head (830c404).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #524   +/-   ##
=======================================
  Coverage   97.71%   97.72%           
=======================================
  Files          19       19           
  Lines        4514     4523    +9     
=======================================
+ Hits         4411     4420    +9     
  Misses         87       87           
  Partials       16       16           

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

@xushiwei xushiwei merged commit f8bacfc into goplus:main Jul 17, 2024
6 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