mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 06:30:19 +00:00
4f7d60c1ea
This adds a safe interface to the machine independent InputArg struct for accessing the index of the original (IR-level) argument. When a non-native return type is lowered, we generate the hidden machine-level sret argument on-the-fly. Before this fix, we were representing this argument as OrigArgIndex == 0, which is an outright lie. In particular this crashed in the AArch64 backend where we actually try to access the type of the original argument. Now we use a sentinel value for machine arguments that have no original argument index. AArch64, ARM, Mips, and PPC now check for this case before accessing the original argument. Fixes <rdar://19792160> Null pointer assertion in AArch64TargetLowering git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229413 91177308-0d34-0410-b5e6-96231b3b80d8
14 lines
375 B
LLVM
14 lines
375 B
LLVM
; RUN: llc %s -o - -mtriple=arm64-apple-ios7.0 | FileCheck %s
|
|
;
|
|
; Handle implicit sret arguments that are generated on-the-fly during lowering.
|
|
; <rdar://19792160> Null pointer assertion in AArch64TargetLowering
|
|
|
|
; CHECK-LABEL: big_retval
|
|
; ... str or stp for the first 1024 bits
|
|
; CHECK: strb wzr, [x8, #128]
|
|
; CHECK: ret
|
|
define i1032 @big_retval() {
|
|
entry:
|
|
ret i1032 0
|
|
}
|