mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 02:45:25 +03:00
Fix function pointers/delegates on Harvard architectures
Resolves issue #4432 by setting the address space of such IR pointers.
This commit is contained in:
parent
4d5553f545
commit
87b22436e4
4 changed files with 35 additions and 5 deletions
|
@ -53,7 +53,8 @@ IrTypeDelegate *IrTypeDelegate::get(Type *t) {
|
|||
IrFuncTy irFty(tf);
|
||||
llvm::Type *ltf =
|
||||
DtoFunctionType(tf, irFty, nullptr, Type::tvoid->pointerTo());
|
||||
llvm::Type *types[] = {getVoidPtrType(), getPtrToType(ltf)};
|
||||
llvm::Type *fptr = ltf->getPointerTo(gDataLayout->getProgramAddressSpace());
|
||||
llvm::Type *types[] = {getVoidPtrType(), fptr};
|
||||
LLStructType *lt = LLStructType::get(gIR->context(), types, false);
|
||||
|
||||
// Could have already built the type as part of a struct forward reference,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue