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

[wip] ssa: fix gocvt named recurs for typeargs. support sync.Map #793

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

visualfc
Copy link
Member

@visualfc visualfc commented Sep 11, 2024

  • ssa: fix goTypes.cvtNamed recurs for typeargs
  • ssa: fix map key has typeargs ( in struct )
  • runtime: fix map len and chan len/cap
  • internal/lib/sync: support sync.Map

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 97.40%. Comparing base (dbaf12b) to head (f6e0959).

Files with missing lines Patch % Lines
cl/compile.go 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #793      +/-   ##
==========================================
- Coverage   97.57%   97.40%   -0.18%     
==========================================
  Files          20       20              
  Lines        5165     5172       +7     
==========================================
- Hits         5040     5038       -2     
- Misses        106      115       +9     
  Partials       19       19              

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

@visualfc visualfc force-pushed the abitypes branch 3 times, most recently from 7c69576 to 22d04e1 Compare September 11, 2024 13:20
@cpunion
Copy link
Contributor

cpunion commented Sep 12, 2024

After apply this PR and change type Future[T any] func(func(T)) to:

type Future[T any] interface {
	Then(func(T))
}

And then run https://github.com/cpunion/llgo/blob/future-io-2/x/async/_demo/all/all.go :

go run ../../../../cmd/llgo run .
# github.com/goplus/llgo/cmd/llgo
ld: warning: dylib (/opt/homebrew/opt/llvm@18/lib/libunwind.dylib) was built for newer macOS version (14.4) than being linked (14.0)
ld: warning: dylib (/opt/homebrew/opt/llvm@18/lib/libunwind.dylib) was built for newer macOS version (14.4) than being linked (14.0)
ld: warning: dylib (/opt/homebrew/opt/llvm@18/lib/libunwind.dylib) was built for newer macOS version (14.4) than being linked (14.0)
ld: warning: dylib (/opt/homebrew/opt/llvm@18/lib/libunwind.dylib) was built for newer macOS version (14.4) than being linked (14.0)
ld64.lld: error: undefined symbol: github.com/goplus/llgo/x/tuple.(*Tuple2[*github.com/goplus/llgo/c/net.SockAddr,error]).Get
>>> referenced by /var/folders/f2/88rgt2bx533_m89qy6pqqp8w0000gn/T/3f61699a9433d85205d63822b9675c530a5ddacf484e0799c65eb62af7d802c2-d-4d8be0.o:(symbol github.com/goplus/llgo/x/socketio.init$after+0x98e4)
>>> referenced by /var/folders/f2/88rgt2bx533_m89qy6pqqp8w0000gn/T/3f61699a9433d85205d63822b9675c530a5ddacf484e0799c65eb62af7d802c2-d-4d8be0.o:(symbol github.com/goplus/llgo/x/socketio.init$after+0x98e0)

ld64.lld: error: undefined symbol: github.com/goplus/llgo/x/tuple.(*Tuple2[*github.com/goplus/llgo/x/socketio.Conn,error]).Get
>>> referenced by /var/folders/f2/88rgt2bx533_m89qy6pqqp8w0000gn/T/3f61699a9433d85205d63822b9675c530a5ddacf484e0799c65eb62af7d802c2-d-4d8be0.o:(symbol github.com/goplus/llgo/x/socketio.init$after+0x6e00)
>>> referenced by /var/folders/f2/88rgt2bx533_m89qy6pqqp8w0000gn/T/3f61699a9433d85205d63822b9675c530a5ddacf484e0799c65eb62af7d802c2-d-4d8be0.o:(symbol github.com/goplus/llgo/x/socketio.init$after+0x6dfc)

ld64.lld: error: undefined symbol: github.com/goplus/llgo/x/tuple.(*Tuple2[[]byte,error]).Get
>>> referenced by /var/folders/f2/88rgt2bx533_m89qy6pqqp8w0000gn/T/3f61699a9433d85205d63822b9675c530a5ddacf484e0799c65eb62af7d802c2-d-4d8be0.o:(symbol github.com/goplus/llgo/x/socketio.init$after+0x1d2c)
>>> referenced by /var/folders/f2/88rgt2bx533_m89qy6pqqp8w0000gn/T/3f61699a9433d85205d63822b9675c530a5ddacf484e0799c65eb62af7d802c2-d-4d8be0.o:(symbol github.com/goplus/llgo/x/socketio.init$after+0x1d28)
>>> referenced by /var/folders/f2/88rgt2bx533_m89qy6pqqp8w0000gn/T/dd0992005a8fb6625e31139e60676709e366d46a5a9c1dabe3df913b4c47007b-d-2db999.o:(symbol main.init$after+0x17dc)
>>> referenced 1 more times
clang: error: linker command failed with exit code 1 (use -v to see invocation)
exit status 1

@cpunion
Copy link
Contributor

cpunion commented Sep 12, 2024

Also need to apply #782, and then test passed.

@visualfc visualfc force-pushed the abitypes branch 7 times, most recently from fa0c2cf to 0436d18 Compare September 16, 2024 12:26
@visualfc visualfc force-pushed the abitypes branch 6 times, most recently from 4edf6bf to f3b983b Compare September 20, 2024 03:46
@visualfc visualfc changed the title ssa: cache types named in runtime ssa: cache types named in runtime. support sync.Map Sep 20, 2024
@visualfc visualfc changed the title ssa: cache types named in runtime. support sync.Map [wip] ssa: cache types named in runtime. support sync.Map Sep 21, 2024
@visualfc visualfc force-pushed the abitypes branch 3 times, most recently from bcd47f5 to 3aefb3b Compare September 22, 2024 08:36
@visualfc visualfc force-pushed the abitypes branch 2 times, most recently from 4d42daf to b72ff15 Compare September 23, 2024 03:30
@visualfc visualfc changed the title [wip] ssa: cache types named in runtime. support sync.Map [wip] ssa: fix gocvt named recurs for typeargs. support sync.Map Sep 23, 2024
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