diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-01-08 20:35:13 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-01-08 20:35:13 +0000 | 
| commit | c0f31c5e9622692f3eca07be498e3d2c399e7041 (patch) | |
| tree | a8f0a5c24276f2bab2f16716e5ba7ead9c77b1ec /llvm/lib/CodeGen | |
| parent | a183eb75eb06882bf73cd2ee93c772617c048bad (diff) | |
| download | bcm5719-llvm-c0f31c5e9622692f3eca07be498e3d2c399e7041.tar.gz bcm5719-llvm-c0f31c5e9622692f3eca07be498e3d2c399e7041.zip | |
Tighten up assertions.
llvm-svn: 19397
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 14 | 
1 files changed, 6 insertions, 8 deletions
| diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 63fcc1c2a72..19e70f59279 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -199,12 +199,12 @@ void SelectionDAGLegalize::LegalizeDAG() {  }  SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { +  assert(getTypeAction(Op.getValueType()) == Legal && +         "Caller should expand or promote operands that are not legal!"); +    // If this operation defines any values that cannot be represented in a -  // register on this target, make sure to expand it. -  if (Op.Val->getNumValues() == 1) {// Fast path == assertion only -    assert(getTypeAction(Op.Val->getValueType(0)) == Legal && -           "For a single use value, caller should check for legality!"); -  } else { +  // register on this target, make sure to expand or promote them. +  if (Op.Val->getNumValues() > 1) {      for (unsigned i = 0, e = Op.Val->getNumValues(); i != e; ++i)        switch (getTypeAction(Op.Val->getValueType(i))) {        case Legal: break;  // Nothing to do. @@ -719,9 +719,7 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){      Hi = SDOperand(NC, 1);      // Insert the new chain mapping. -    bool isNew = LegalizedNodes.insert(std::make_pair(Op.getValue(1), -                                                      Hi.getValue(2))).second; -    assert(isNew && "This node was already legalized!"); +    AddLegalizedOperand(Op.getValue(1), Hi.getValue(2));      break;    }    case ISD::AND: | 

