1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00

Revert "[IR] Don't accept nullptr as GEP element type"

This reverts commit 5035e7be1a8ab923e1a82def7e313cc11c0b176f.

This change broke several lldb bots.
This commit is contained in:
Stella Stamenova 2021-07-09 11:32:39 -07:00
parent aec055247a
commit aff94971f7

View File

@ -956,9 +956,13 @@ public:
const Twine &NameStr = "",
Instruction *InsertBefore = nullptr) {
unsigned Values = 1 + unsigned(IdxList.size());
assert(PointeeType && "Must specify element type");
assert(cast<PointerType>(Ptr->getType()->getScalarType())
->isOpaqueOrPointeeTypeMatches(PointeeType));
if (!PointeeType) {
PointeeType =
cast<PointerType>(Ptr->getType()->getScalarType())->getElementType();
} else {
assert(cast<PointerType>(Ptr->getType()->getScalarType())
->isOpaqueOrPointeeTypeMatches(PointeeType));
}
return new (Values) GetElementPtrInst(PointeeType, Ptr, IdxList, Values,
NameStr, InsertBefore);
}
@ -968,9 +972,13 @@ public:
const Twine &NameStr,
BasicBlock *InsertAtEnd) {
unsigned Values = 1 + unsigned(IdxList.size());
assert(PointeeType && "Must specify element type");
assert(cast<PointerType>(Ptr->getType()->getScalarType())
->isOpaqueOrPointeeTypeMatches(PointeeType));
if (!PointeeType) {
PointeeType =
cast<PointerType>(Ptr->getType()->getScalarType())->getElementType();
} else {
assert(cast<PointerType>(Ptr->getType()->getScalarType())
->isOpaqueOrPointeeTypeMatches(PointeeType));
}
return new (Values) GetElementPtrInst(PointeeType, Ptr, IdxList, Values,
NameStr, InsertAtEnd);
}