mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-28 06:27:16 +00:00
* Add assertion to ExprTypeConvert to detect error earlier than without it
* Fix bug in LevelRaise.cpp, correcting this problem: test/Regression/Transforms/LevelRaise/2002-07-16-RaiseCrash.ll llvm-svn: 2920
This commit is contained in:
parent
7627301035
commit
43cfac7e68
@ -903,6 +903,7 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
|
||||
Instruction *I = cast<Instruction>(U); // Only Instructions convertable
|
||||
|
||||
BasicBlock *BB = I->getParent();
|
||||
assert(BB != 0 && "Instruction not embedded in basic block!");
|
||||
BasicBlock::InstListType &BIL = BB->getInstList();
|
||||
std::string Name = I->getName(); if (!Name.empty()) I->setName("");
|
||||
Instruction *Res; // Result of conversion
|
||||
|
@ -227,6 +227,7 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
|
||||
// source type of the cast...
|
||||
//
|
||||
ConvertedTypes.clear();
|
||||
ConvertedTypes[CI] = Src->getType(); // Make sure the cast _does_ change
|
||||
if (ValueConvertableToType(CI, Src->getType(), ConvertedTypes)) {
|
||||
PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", Src, CI, BB->getParent());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user