Skip to content

Commit 127d955

Browse files
committed
[ConstantFold] Drop unused function (NFC)
isMaybeZeroSizeType() is no longer used after 5afbfe3.
1 parent d38637a commit 127d955

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

llvm/lib/IR/ConstantFold.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,23 +1299,6 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1,
12991299
return nullptr;
13001300
}
13011301

1302-
/// This type is zero-sized if it's an array or structure of zero-sized types.
1303-
/// The only leaf zero-sized type is an empty structure.
1304-
static bool isMaybeZeroSizedType(Type *Ty) {
1305-
if (StructType *STy = dyn_cast<StructType>(Ty)) {
1306-
if (STy->isOpaque()) return true; // Can't say.
1307-
1308-
// If all of elements have zero size, this does too.
1309-
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
1310-
if (!isMaybeZeroSizedType(STy->getElementType(i))) return false;
1311-
return true;
1312-
1313-
} else if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
1314-
return isMaybeZeroSizedType(ATy->getElementType());
1315-
}
1316-
return false;
1317-
}
1318-
13191302
/// This function determines if there is anything we can decide about the two
13201303
/// constants provided. This doesn't need to handle simple things like
13211304
/// ConstantFP comparisons, but should instead handle ConstantExprs.

0 commit comments

Comments
 (0)