Skip to content

Commit

Permalink
Fix for missing addrspace cast in LLVM 17.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Feb 3, 2024
1 parent 73cf43f commit 5b37d0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tcompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2828,7 +2828,11 @@ struct FunctionEmitter {
#if LLVM_VERSION < 170
return B->CreateBitCast(v, toT->type);
#else
return v;
if (fromT->type->getPointerAddressSpace() != toT->type->getPointerAddressSpace()) {
return B->CreateAddrSpaceCast(v, toT->type);
} else {
return v;
}
#endif
} else {
assert(toT->type->isIntegerTy());
Expand Down

0 comments on commit 5b37d0d

Please sign in to comment.