Skip to content

Commit b294bf4

Browse files
committed
Add missing feature check for data layout pointer handling
1 parent 4ed1b49 commit b294bf4

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ struct MissingFeatures {
209209
static bool dataLayoutTypeIsSized() { return false; }
210210
static bool dataLayoutTypeAllocSize() { return false; }
211211
static bool dataLayoutTypeStoreSize() { return false; }
212+
static bool dataLayoutPtrHandlingBasedOnLangAS() { return false; }
212213
static bool deferredCXXGlobalInit() { return false; }
213214
static bool deleteArray() { return false; }
214215
static bool devirtualizeMemberFunction() { return false; }

clang/lib/CIR/Dialect/IR/CIRTypes.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,15 @@ llvm::TypeSize
323323
PointerType::getTypeSizeInBits(const ::mlir::DataLayout &dataLayout,
324324
::mlir::DataLayoutEntryListRef params) const {
325325
// FIXME: improve this in face of address spaces
326+
assert(!cir::MissingFeatures::dataLayoutPtrHandlingBasedOnLangAS());
326327
return llvm::TypeSize::getFixed(64);
327328
}
328329

329330
uint64_t
330331
PointerType::getABIAlignment(const ::mlir::DataLayout &dataLayout,
331332
::mlir::DataLayoutEntryListRef params) const {
332333
// FIXME: improve this in face of address spaces
334+
assert(!cir::MissingFeatures::dataLayoutPtrHandlingBasedOnLangAS());
333335
return 8;
334336
}
335337

0 commit comments

Comments
 (0)