mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 14:03:39 +00:00
all: fix LLVM version compatibility for targets and interp
cc1as: change AssemblerInvocation.Triple from std::string to llvm::Triple, matching upstream LLVM 22 and fixing deprecation warnings for lookupTarget, createMCRegInfo, createMCAsmInfo, and createMCSubtargetInfo. interp: always use ConstNamedStruct in rawValue.toLLVMValue instead of falling back to ConstStruct for unnamed structs. LLVM 22 uses anonymous identified struct types where previous versions used literal structs; ConstStruct creates a literal type that doesn't match, causing an "initializer type mismatch" panic for globals like fmt.ppFree. compileopts: add build-tag-guarded feature patching for pre-LLVM 20 (strip +bulk-memory-opt and +call-indirect-overlong from wasm features) and restructure into three files covering all LLVM version ranges. targets: strip redundant negative features from RISC-V target JSONs (esp32c3, esp32c6, fe310, k210, riscv-qemu, tkey). These ~190 negative features per target listed every extension LLVM knows about that the target doesn't use, but LLVM disables them by default. They became stale across LLVM versions, causing "not a recognized feature" warnings. Keep only positive features and -relax. Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
+4
-4
@@ -931,10 +931,10 @@ func (v rawValue) toLLVMValue(llvmType llvm.Type, mem *memoryView) (llvm.Value,
|
||||
return llvm.Value{}, err
|
||||
}
|
||||
}
|
||||
if llvmType.StructName() != "" {
|
||||
return llvm.ConstNamedStruct(llvmType, fields), nil
|
||||
}
|
||||
return llvmType.Context().ConstStruct(fields, false), nil
|
||||
// Always use ConstNamedStruct to preserve the exact type identity.
|
||||
// ConstStruct creates a literal struct type which may differ from an
|
||||
// anonymous identified struct even when structurally identical.
|
||||
return llvm.ConstNamedStruct(llvmType, fields), nil
|
||||
case llvm.ArrayTypeKind:
|
||||
numElements := llvmType.ArrayLength()
|
||||
childType := llvmType.ElementType()
|
||||
|
||||
Reference in New Issue
Block a user