goplus / llgo

A Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python
Apache License 2.0
356 stars 26 forks source link

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

Closed visualfc closed 2 weeks ago

visualfc commented 2 months ago
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.62%. Comparing base (67c9a14) to head (38091b2). Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
cl/compile.go 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #793 +/- ## ========================================== + Coverage 97.58% 97.62% +0.03% ========================================== Files 20 20 Lines 5962 5968 +6 ========================================== + Hits 5818 5826 +8 + Misses 121 120 -1 + Partials 23 22 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cpunion commented 2 months ago

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 commented 2 months ago

Also need to apply https://github.com/goplus/llgo/pull/782, and then test passed.

luoliwoshang commented 1 month ago

This pr can fix this issue https://github.com/goplus/llgo/issues/808