Add support for LLVM 17. (#4533)

This commit is contained in:
Johan Engelen 2023-12-03 19:07:31 +01:00 committed by GitHub
parent fb637c408f
commit 91d306894e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 4309 additions and 73 deletions

View file

@ -882,7 +882,12 @@ void defineParameters(IrFuncTy &irFty, VarDeclarations &parameters) {
if (irparam->arg->byref) {
// The argument is an appropriate lvalue passed by reference.
// Use the passed pointer as parameter storage.
#if LDC_LLVM_VER >= 1700 // LLVM >= 17 uses opaque pointers, type check boils
// down to pointer check only.
assert(irparam->value->getType()->isPointerTy());
#else
assert(irparam->value->getType() == DtoPtrToType(paramType));
#endif
} else {
// Let the ABI transform the parameter back to an lvalue.
irparam->value =