Skip to content

Commit 3d454d2

Browse files
[LLVM][TypeSize] Remove default constructor. (#82810)
1 parent fe97a59 commit 3d454d2

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

clang/lib/CodeGen/CGCall.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3221,12 +3221,10 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
32213221

32223222
llvm::StructType *STy =
32233223
dyn_cast<llvm::StructType>(ArgI.getCoerceToType());
3224-
llvm::TypeSize StructSize;
3225-
llvm::TypeSize PtrElementSize;
32263224
if (ArgI.isDirect() && !ArgI.getCanBeFlattened() && STy &&
32273225
STy->getNumElements() > 1) {
3228-
StructSize = CGM.getDataLayout().getTypeAllocSize(STy);
3229-
PtrElementSize =
3226+
llvm::TypeSize StructSize = CGM.getDataLayout().getTypeAllocSize(STy);
3227+
llvm::TypeSize PtrElementSize =
32303228
CGM.getDataLayout().getTypeAllocSize(ConvertTypeForMem(Ty));
32313229
if (STy->containsHomogeneousScalableVectorTypes()) {
32323230
assert(StructSize == PtrElementSize &&
@@ -5310,12 +5308,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
53105308

53115309
llvm::StructType *STy =
53125310
dyn_cast<llvm::StructType>(ArgInfo.getCoerceToType());
5313-
llvm::Type *SrcTy = ConvertTypeForMem(I->Ty);
5314-
llvm::TypeSize SrcTypeSize;
5315-
llvm::TypeSize DstTypeSize;
53165311
if (STy && ArgInfo.isDirect() && !ArgInfo.getCanBeFlattened()) {
5317-
SrcTypeSize = CGM.getDataLayout().getTypeAllocSize(SrcTy);
5318-
DstTypeSize = CGM.getDataLayout().getTypeAllocSize(STy);
5312+
llvm::Type *SrcTy = ConvertTypeForMem(I->Ty);
5313+
llvm::TypeSize SrcTypeSize =
5314+
CGM.getDataLayout().getTypeAllocSize(SrcTy);
5315+
llvm::TypeSize DstTypeSize = CGM.getDataLayout().getTypeAllocSize(STy);
53195316
if (STy->containsHomogeneousScalableVectorTypes()) {
53205317
assert(SrcTypeSize == DstTypeSize &&
53215318
"Only allow non-fractional movement of structure with "

llvm/include/llvm/Support/TypeSize.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,6 @@ class TypeSize : public details::FixedOrScalableQuantity<TypeSize, uint64_t> {
321321
: FixedOrScalableQuantity(V) {}
322322

323323
public:
324-
constexpr TypeSize() : FixedOrScalableQuantity(0, false) {}
325-
326324
constexpr TypeSize(ScalarTy Quantity, bool Scalable)
327325
: FixedOrScalableQuantity(Quantity, Scalable) {}
328326

llvm/unittests/Support/TypeSizeTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ static_assert(INT64_C(2) * TSFixed32 == TypeSize::getFixed(64));
8181
static_assert(UINT64_C(2) * TSFixed32 == TypeSize::getFixed(64));
8282
static_assert(alignTo(TypeSize::getFixed(7), 8) == TypeSize::getFixed(8));
8383

84-
static_assert(TypeSize() == TypeSize::getFixed(0));
8584
static_assert(TypeSize::getZero() == TypeSize::getFixed(0));
8685
static_assert(TypeSize::getZero() != TypeSize::getScalable(0));
8786
static_assert(TypeSize::getFixed(0) != TypeSize::getScalable(0));

0 commit comments

Comments
 (0)