Files
hakorune/apps/tests/ny-plugin-ret-llvm-smoke/main.nyash
Selfhosting Dev 1fd37bf14a refactor(llvm): Complete modularization of codegen.rs by Codex
- Split 2522-line codegen.rs into modular structure:
  - mod.rs (1330 lines) - main compilation flow and instruction dispatch
  - instructions.rs (1266 lines) - all MIR instruction implementations
  - types.rs (189 lines) - type conversion and classification helpers
  - helpers.rs retained for shared utilities

- Preserved all functionality including:
  - Plugin return value handling (BoxCall/ExternCall)
  - Handle-to-pointer conversions for proper value display
  - Type-aware return value processing based on MIR metadata
  - All optimization paths (ArrayBox fast-paths, string concat, etc.)

- Benefits:
  - Better code organization and maintainability
  - Easier to locate specific functionality
  - Reduced cognitive load when working on specific features
  - Cleaner separation of concerns

No functional changes - pure refactoring to improve code structure.
2025-09-11 17:51:43 +09:00

16 lines
383 B
Plaintext

// ny-plugin-ret-llvm-smoke
// Purpose: Verify plugin return values are preserved through assign/print
// - CounterBox.get() returns integer; return it from main (AOT prints Result: <n>)
// - StringBox.concat returns string; print it via print()
local c = new CounterBox()
c.inc()
local v = c.get()
local s = new StringBox("ab")
local t = s.concat("CD")
print("S=" + t)
return v