mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +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) {
|
||||
assert(II.getRawDest() == *U && "Pointer use is not the destination?");
|
||||
ConstantInt *Length = dyn_cast<ConstantInt>(II.getLength());
|
||||
insertUse(II, Length ? Length->getZExtValue() : AllocSize - Offset, Length);
|
||||
return true;
|
||||
@ -2440,6 +2441,7 @@ bool SROA::rewriteAllocaPartition(AllocaInst &AI,
|
||||
AllocaTy = Type::getIntNTy(*C, AllocaSize * 8);
|
||||
if (!AllocaTy)
|
||||
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
|
||||
// exact same type as the original, and with the same access offsets. In that
|
||||
|
Loading…
x
Reference in New Issue
Block a user