Skip to content

Commit a572c3f

Browse files
committed
IRGen: Rename internal 'POD' references to 'TriviallyDestroyable'.
Noncopyable types aren't really "POD", but the bit is still useful to track whether a noncopyable type has a no-op destroy operation, so rename the existing bit to be more specific within IRGen's implementation. Don't rename it in the runtime or Builtin names yet, since doing so will require a naming transition for compatibility.
1 parent f20eaac commit a572c3f

31 files changed

+292
-260
lines changed

lib/IRGen/FixedTypeInfo.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class FixedTypeInfo : public TypeInfo {
4242
protected:
4343
FixedTypeInfo(llvm::Type *type, Size size,
4444
const SpareBitVector &spareBits,
45-
Alignment align, IsPOD_t pod, IsBitwiseTakable_t bt,
45+
Alignment align, IsTriviallyDestroyable_t pod, IsBitwiseTakable_t bt,
4646
IsFixedSize_t alwaysFixedSize,
4747
SpecialTypeInfoKind stik = SpecialTypeInfoKind::Fixed)
4848
: TypeInfo(type, align, pod, bt, alwaysFixedSize, IsABIAccessible, stik),
@@ -55,7 +55,7 @@ class FixedTypeInfo : public TypeInfo {
5555

5656
FixedTypeInfo(llvm::Type *type, Size size,
5757
SpareBitVector &&spareBits,
58-
Alignment align, IsPOD_t pod, IsBitwiseTakable_t bt,
58+
Alignment align, IsTriviallyDestroyable_t pod, IsBitwiseTakable_t bt,
5959
IsFixedSize_t alwaysFixedSize,
6060
SpecialTypeInfoKind stik = SpecialTypeInfoKind::Fixed)
6161
: TypeInfo(type, align, pod, bt, alwaysFixedSize, IsABIAccessible, stik),
@@ -90,7 +90,7 @@ class FixedTypeInfo : public TypeInfo {
9090
llvm::Value *getSize(IRGenFunction &IGF, SILType T) const override;
9191
llvm::Value *getAlignmentMask(IRGenFunction &IGF, SILType T) const override;
9292
llvm::Value *getStride(IRGenFunction &IGF, SILType T) const override;
93-
llvm::Value *getIsPOD(IRGenFunction &IGF, SILType T) const override;
93+
llvm::Value *getIsTriviallyDestroyable(IRGenFunction &IGF, SILType T) const override;
9494
llvm::Value *getIsBitwiseTakable(IRGenFunction &IGF, SILType T) const override;
9595
llvm::Value *isDynamicallyPackedInline(IRGenFunction &IGF,
9696
SILType T) const override;

lib/IRGen/GenBuiltin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
173173
(void)args.claimAll();
174174
auto valueTy = getLoweredTypeAndTypeInfo(IGF.IGM,
175175
substitutions.getReplacementTypes()[0]);
176-
out.add(valueTy.second.getIsPOD(IGF, valueTy.first));
176+
out.add(valueTy.second.getIsTriviallyDestroyable(IGF, valueTy.first));
177177
return;
178178
}
179179

lib/IRGen/GenConcurrency.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ExecutorTypeInfo :
4343
ExecutorTypeInfo(llvm::StructType *storageType,
4444
Size size, Alignment align, SpareBitVector &&spareBits)
4545
: TrivialScalarPairTypeInfo(storageType, size, std::move(spareBits),
46-
align, IsPOD, IsFixedSize) {}
46+
align, IsTriviallyDestroyable, IsFixedSize) {}
4747

4848
static Size getFirstElementSize(IRGenModule &IGM) {
4949
return IGM.getPointerSize();
@@ -60,7 +60,7 @@ class ExecutorTypeInfo :
6060
return IGM.typeLayoutCache.getOrCreateTypeInfoBasedEntry(*this, T);
6161
}
6262
return IGM.typeLayoutCache.getOrCreateScalarEntry(*this, T,
63-
ScalarKind::POD);
63+
ScalarKind::TriviallyDestroyable);
6464
}
6565

6666
static Size getSecondElementOffset(IRGenModule &IGM) {

lib/IRGen/GenDiffFunc.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ class DifferentiableFuncTypeInfo final
9494
DifferentiableFuncTypeInfo(ArrayRef<DifferentiableFuncFieldInfo> fields,
9595
unsigned explosionSize, llvm::Type *ty, Size size,
9696
SpareBitVector &&spareBits, Alignment align,
97-
IsPOD_t isPOD, IsFixedSize_t alwaysFixedSize)
97+
IsTriviallyDestroyable_t isTriviallyDestroyable, IsFixedSize_t alwaysFixedSize)
9898
: super(fields, explosionSize, ty, size, std::move(spareBits), align,
99-
isPOD, alwaysFixedSize) {}
99+
isTriviallyDestroyable, alwaysFixedSize) {}
100100

101101
Address projectFieldAddress(IRGenFunction &IGF, Address addr, SILType T,
102102
const DifferentiableFuncFieldInfo &field) const {
@@ -179,7 +179,7 @@ class DifferentiableFuncTypeBuilder
179179
StructLayout &&layout, unsigned explosionSize) {
180180
return DifferentiableFuncTypeInfo::create(
181181
fields, explosionSize, layout.getType(), layout.getSize(),
182-
std::move(layout.getSpareBits()), layout.getAlignment(), layout.isPOD(),
182+
std::move(layout.getSpareBits()), layout.getAlignment(), layout.isTriviallyDestroyable(),
183183
layout.isAlwaysFixedSize());
184184
}
185185

@@ -267,10 +267,10 @@ class LinearFuncTypeInfo final
267267
public:
268268
LinearFuncTypeInfo(ArrayRef<LinearFuncFieldInfo> fields,
269269
unsigned explosionSize, llvm::Type *ty, Size size,
270-
SpareBitVector &&spareBits, Alignment align, IsPOD_t isPOD,
270+
SpareBitVector &&spareBits, Alignment align, IsTriviallyDestroyable_t isTriviallyDestroyable,
271271
IsFixedSize_t alwaysFixedSize)
272272
: super(fields, explosionSize, ty, size, std::move(spareBits), align,
273-
isPOD, alwaysFixedSize) {}
273+
isTriviallyDestroyable, alwaysFixedSize) {}
274274

275275
Address projectFieldAddress(IRGenFunction &IGF, Address addr, SILType T,
276276
const LinearFuncFieldInfo &field) const {
@@ -347,7 +347,7 @@ class LinearFuncTypeBuilder
347347
unsigned explosionSize) {
348348
return LinearFuncTypeInfo::create(
349349
fields, explosionSize, layout.getType(), layout.getSize(),
350-
std::move(layout.getSpareBits()), layout.getAlignment(), layout.isPOD(),
350+
std::move(layout.getSpareBits()), layout.getAlignment(), layout.isTriviallyDestroyable(),
351351
layout.isAlwaysFixedSize());
352352
}
353353

0 commit comments

Comments
 (0)