Fix a bug that caused a crash if a setcc had zero uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-09-14 18:29:28 +00:00
parent c0c77083ba
commit ffe335ace1

View File

@ -1688,7 +1688,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
// to follow SSA def-use edges here, not BURG tree edges.
//
Instruction* result = subtreeRoot->getInstruction();
Value* firstUse = (Value*) * result->use_begin();
Value* firstUse = result->use_empty() ? 0 : *result->use_begin();
bool discardResult =
(result->use_size() == 1
&& firstUse->isInstruction()