Commit Graph

149 Commits

Author SHA1 Message Date
xgopilot
c47d60d05c test: update interface test outputs after Named type preservation fix
Regenerated all out.ll test files using llgen to reflect the interface
metadata fix in ssa/abitype.go and ssa/interface.go. The Named interface
type information is now properly preserved through interface construction,
ensuring correct package path metadata for cross-package conversions.

Files updated:
- cl/_testgo/errors/out.ll
- cl/_testgo/ifaceconv/out.ll
- cl/_testgo/ifaceprom/out.ll
- cl/_testgo/interface/out.ll
- cl/_testgo/invoke/out.ll
- cl/_testgo/reader/out.ll
- cl/_testgo/reflect/out.ll
- cl/_testrt/tpabi/out.ll
- cl/_testrt/tpmethod/out.ll
- cl/_testrt/vamethod/out.ll

Test results:
- TestFromTestgo: 48/49 passed (cgofull failed due to missing Python deps)
- TestFromTestrt: 58/58 passed (100%)

🤖 Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-28 14:08:10 +00:00
xgopilot
2d4d516687 test: update interface1370 test outputs after Named type preservation fix
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 10:56:39 +00:00
xgopilot
05da9ec252 fix: preserve Named interface type information through interface construction
This commit addresses the root cause identified in issue #1370 by preserving
Named interface type information through the interface construction phase.

**Root Cause:**
Named interfaces were prematurely unwrapped via Underlying() in the interface
construction phase (MakeInterface()/unsafeInterface()), causing the subsequent
ABI type generation to hit `case *types.Interface:` instead of
`case *types.Named:`, resulting in loss of package information.

**The Fix:**
1. Modified `unsafeInterface()` to accept a `namedIntf types.Type` parameter
2. Updated all callers to pass the Named type (tinter.raw.Type, assertedTyp.raw.Type, etc.)
3. When namedIntf is available, pass it to `abiType()` to ensure proper routing
   through the type switch to `abiNamedInterfaceOf()` which has correct package context
4. Reverted the workaround logic in `abiInterfaceOf()` that extracted pkgPath from methods

**Impact:**
- Fixes segmentation faults when calling interface private methods across packages
- Ensures runtime receives correct package path for interface metadata
- Allows private method slots in itab to be properly filled

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 10:32:20 +00:00
xgopilot
670f880c78 refactor(test): move issue #1370 geometry test to cl/_testgo/interface1370
- Move geometry package from _demo to cl/_testdata/geometry1370
- Create simplified test in cl/_testgo/interface1370 following interface test pattern
- Generate .ll file with llgen to verify interface metadata package path fix
- Remove old demo files (issue1370_geometry, issue1370_goast, issue1370_gotypes)
- Remove .tmp-comment files

The new test structure is simpler and follows the existing cl/_testgo/interface pattern,
focusing on demonstrating the interface metadata fix for private methods across packages.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-27 08:03:58 +00:00
xgopilot
5358d16eb7 test(cl): regenerate interface test .ll file after llgen update
Reinstalled llgen tool and regenerated test case to reflect the interface
metadata package path fix. The generated LLVM IR now correctly uses the
interface definition package path instead of the compilation package path.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
2025-10-23 13:23:51 +00:00
visualfc
5592a8fc26 ssa: fix abiTupleOf 2025-09-25 20:16:44 +08:00
visualfc
56f90dbcf9 ssa: fix TypeAssert check null 2025-08-08 12:11:17 +08:00
luoliwoshang
6e8f3d1d19 test(build):collect llgo test ./... output to test 2025-06-25 15:38:20 +08:00
xushiwei
e9c96390e6 Merge pull request #1151 from luoliwoshang/internal/build/testdir
internal/build:switch workdir from testpkg like go behavior
2025-06-22 15:26:07 +08:00
visualfc
2118849d27 cl/_testgo/reflectmkfn 2025-06-13 09:13:48 +08:00
luoliwoshang
48bd1d46af internal/build:switch workdir from testpkg like go behavior 2025-06-12 16:49:40 +08:00
visualfc
cfc8687851 lib/reflect: fix closure pointer 2025-05-16 12:00:59 +08:00
visualfc
c4f0dd124d cl: funcName check $bound 2025-05-15 21:12:18 +08:00
visualfc
e8a91696d6 go.mod go1.23 2025-05-05 10:19:23 +08:00
Li Jie
c8d791f206 fix llgo test unit test 2025-04-03 16:32:46 +08:00
Li Jie
ed366568b4 move out c/cpp/py 2025-04-03 16:26:11 +08:00
Li Jie
1172e5bdce build: separate compiler and libs 2025-01-08 14:59:01 +08:00
Li Jie
03b469212e feat: upgrade to x/tools 0.28 2025-01-08 14:58:59 +08:00
visualfc
a6a3c09c05 ssa: closure use specific struct field name { $f ftype, $data unsafe.pointer } 2024-12-22 12:44:33 +08:00
visualfc
ef28abe896 internal/runtime: funcStr, interfaceStr, array str 2024-12-20 12:33:34 +08:00
visualfc
d251232f8a internal/runtime: named(ptr) type preset for method type 2024-12-20 11:37:30 +08:00
xushiwei
b4af70ada9 Merge pull request #916 from visualfc/runtime.interface
abi: fix named interface init
2024-12-17 14:43:15 +08:00
visualfc
e55a5d7486 internal/runtime: NewNamedInterface, InitNamedInterface 2024-12-16 12:07:13 +08:00
xushiwei
29ad96862f Merge pull request #628 from visualfc/go
ssa: fix ssa.go for builtin
2024-12-14 06:44:35 +08:00
七叶
3505be422e Revert "ssa: defer load/store func and args" 2024-12-03 21:00:49 +08:00
visualfc
7eeb8084bf ssa: fix ssa.go for builtin 2024-12-02 15:40:56 +08:00
visualfc
6e8cecd13e cl/_testgo: defer6 2024-12-02 11:43:20 +08:00
Li Jie
c3407eac5e cgo: supports //export functions only calls in C 2024-11-27 20:24:53 +08:00
Li Jie
e46b3e24d6 test: move cgo demo into _testgo, and make links 2024-11-27 18:41:56 +08:00
Li Jie
90763de93c cgo: supports c/go callback funcs 2024-11-27 18:41:56 +08:00
Li Jie
c9f436cc47 cgo: full test
cgo: test returning void
2024-11-27 18:41:56 +08:00
visualfc
91b46b05ad cl/_testgo/reflect: map demo 2024-11-27 11:31:28 +08:00
Li Jie
954cc0e8bc test: ignore syncmap since different pthread_mutex_t size on macOS and linux 2024-11-26 13:21:33 +08:00
Li Jie
ad48325dff test: regenerate test fixtures 2024-11-26 13:21:01 +08:00
visualfc
c2138037d2 internal/lib/reflect: call variadic check 2024-11-26 12:46:11 +08:00
visualfc
fadd64c1e9 ssa: cvtClosure remove closureCtx param 2024-11-26 12:46:11 +08:00
Li Jie
6099369019 test: update generated code 2024-11-25 11:18:46 +08:00
xushiwei
8d2b65386c Merge pull request #874 from cpunion/fix-closure
ssa: fix wrong reflect type of closure
2024-11-25 11:05:04 +08:00
Li Jie
43c1bc8d5f ssa: compile go string constant without alloca 2024-11-24 15:29:20 +08:00
Li Jie
17832fe18c ssa: fix type of ChanOp.Size 2024-11-24 15:21:32 +08:00
Li Jie
252f3f0bd6 ssa: fix closure type 2024-11-24 10:54:00 +08:00
visualfc
e6de8401bf internal/lib/reflect: makeMethodValue 2024-11-19 20:51:08 +08:00
visualfc
df2e34ac51 internal/lib/reflect: call.method 2024-11-19 20:51:08 +08:00
visualfc
7bbd3a7e36 internal/lib/reflect: TypeOf check closure 2024-11-19 20:51:07 +08:00
visualfc
6b0122547e reflect.call: internal/abi: TFlagClosure, internal/lib/reflect: flagClosure. 2024-11-01 15:27:40 +08:00
visualfc
ce87f293aa ssa: fix map key has typeargs 2024-10-30 20:22:05 +08:00
visualfc
dca028a84f ssa: fix goTypes.cvtNamed recurs for typeargs 2024-10-30 20:22:05 +08:00
visualfc
2b5fdd3548 ssa: fix closure type 2024-10-29 20:50:02 +08:00
xushiwei
ae8ad3b68b Merge pull request #837 from cpunion/const-conv
ssa: fix int constant type conversion
2024-10-23 10:58:08 +08:00
Li Jie
7d7d4db329 ssa: fix int constant type conversion 2024-10-21 18:50:32 +08:00