mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-02 10:33:53 +00:00
In debug builds check that the key property holds: all
result and operand types are legal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47546 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
79a0c1e46c
commit
1a9c9df1db
@ -173,18 +173,36 @@ NodeDone:
|
||||
#ifndef NDEBUG
|
||||
for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
|
||||
E = DAG.allnodes_end(); I != E; ++I) {
|
||||
if (I->getNodeId() == Processed)
|
||||
continue;
|
||||
cerr << "Unprocessed node: ";
|
||||
I->dump(&DAG); cerr << "\n";
|
||||
bool Failed = false;
|
||||
|
||||
if (I->getNodeId() == NewNode)
|
||||
cerr << "New node not 'noticed'?\n";
|
||||
else if (I->getNodeId() > 0)
|
||||
cerr << "Operand not processed?\n";
|
||||
else if (I->getNodeId() == ReadyToProcess)
|
||||
cerr << "Not added to worklist?\n";
|
||||
abort();
|
||||
// Check that all result types are legal.
|
||||
for (unsigned i = 0, NumVals = I->getNumValues(); i < NumVals; ++i)
|
||||
if (!isTypeLegal(I->getValueType(i))) {
|
||||
cerr << "Result type " << i << " illegal!\n";
|
||||
Failed = true;
|
||||
}
|
||||
|
||||
// Check that all operand types are legal.
|
||||
for (unsigned i = 0, NumOps = I->getNumOperands(); i < NumOps; ++i)
|
||||
if (!isTypeLegal(I->getOperand(i).getValueType())) {
|
||||
cerr << "Operand type " << i << " illegal!\n";
|
||||
Failed = true;
|
||||
}
|
||||
|
||||
if (I->getNodeId() != Processed) {
|
||||
if (I->getNodeId() == NewNode)
|
||||
cerr << "New node not 'noticed'?\n";
|
||||
else if (I->getNodeId() > 0)
|
||||
cerr << "Operand not processed?\n";
|
||||
else if (I->getNodeId() == ReadyToProcess)
|
||||
cerr << "Not added to worklist?\n";
|
||||
Failed = true;
|
||||
}
|
||||
|
||||
if (Failed) {
|
||||
I->dump(&DAG); cerr << "\n";
|
||||
abort();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user