mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-23 05:29:23 +00:00
Add two asserts that Duncan thought would help ensure things don't rot
unexpectedly in the future. More fixes from his code review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
63db8bebe6
commit
b3dd9a13e8
@ -567,6 +567,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
bool visitMemSetInst(MemSetInst &II) {
|
bool visitMemSetInst(MemSetInst &II) {
|
||||||
|
assert(II.getRawDest() == *U && "Pointer use is not the destination?");
|
||||||
ConstantInt *Length = dyn_cast<ConstantInt>(II.getLength());
|
ConstantInt *Length = dyn_cast<ConstantInt>(II.getLength());
|
||||||
insertUse(II, Length ? Length->getZExtValue() : AllocSize - Offset, Length);
|
insertUse(II, Length ? Length->getZExtValue() : AllocSize - Offset, Length);
|
||||||
return true;
|
return true;
|
||||||
@ -2440,6 +2441,7 @@ bool SROA::rewriteAllocaPartition(AllocaInst &AI,
|
|||||||
AllocaTy = Type::getIntNTy(*C, AllocaSize * 8);
|
AllocaTy = Type::getIntNTy(*C, AllocaSize * 8);
|
||||||
if (!AllocaTy)
|
if (!AllocaTy)
|
||||||
AllocaTy = ArrayType::get(Type::getInt8Ty(*C), AllocaSize);
|
AllocaTy = ArrayType::get(Type::getInt8Ty(*C), AllocaSize);
|
||||||
|
assert(TD->getTypeAllocSize(AllocaTy) >= AllocaSize);
|
||||||
|
|
||||||
// Check for the case where we're going to rewrite to a new alloca of the
|
// Check for the case where we're going to rewrite to a new alloca of the
|
||||||
// exact same type as the original, and with the same access offsets. In that
|
// exact same type as the original, and with the same access offsets. In that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user