================
@@ -254,16 +254,18 @@ class LLVM_LIBRARY_VISIBILITY SPIR32TargetInfo : public
SPIRTargetInfo {
: SPIRTargetInfo(Triple, Opts) {
assert(Triple.getArch() == llvm::Triple::spir &&
"Invalid architecture for 32-bit SPIR.");
- // FIXME: Assert that a present host target's pointer types match the ones
- // set below, once the driver diagnoses unsupported host/device
combinations
- // (until then such an assert would fire on existing tests).
PointerWidth = PointerAlign = 32;
- const TargetInfo *HostTarget = getHostTarget();
- if (!HostTarget || HostTarget->getPointerWidth(LangAS::Default) != 32) {
+ if (!getHostTarget()) {
SizeType = TargetInfo::UnsignedInt;
PtrDiffType = IntPtrType = TargetInfo::SignedInt;
}
+ // Host and device pointer related type widths must match.
+ assert(PointerWidth == 32 && PointerAlign == 32 &&
+ getTypeWidth(SizeType) == 32 && getTypeWidth(PtrDiffType) == 32 &&
+ getTypeWidth(IntPtrType) == 32 &&
+ "Invalid pointer related types for SPIR32");
----------------
schittir wrote:
That was a miss. Thanks for catching it.
https://github.com/llvm/llvm-project/pull/215620
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits