llvm.org GIT mirror llvm / 1a9c9df
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 Duncan Sands 12 years ago
1 changed file(s) with 30 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
172172 #ifndef NDEBUG
173173 for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
174174 E = DAG.allnodes_end(); I != E; ++I) {
175 if (I->getNodeId() == Processed)
176 continue;
177 cerr << "Unprocessed node: ";
178 I->dump(&DAG); cerr << "\n";
179
180 if (I->getNodeId() == NewNode)
181 cerr << "New node not 'noticed'?\n";
182 else if (I->getNodeId() > 0)
183 cerr << "Operand not processed?\n";
184 else if (I->getNodeId() == ReadyToProcess)
185 cerr << "Not added to worklist?\n";
186 abort();
175 bool Failed = false;
176
177 // Check that all result types are legal.
178 for (unsigned i = 0, NumVals = I->getNumValues(); i < NumVals; ++i)
179 if (!isTypeLegal(I->getValueType(i))) {
180 cerr << "Result type " << i << " illegal!\n";
181 Failed = true;
182 }
183
184 // Check that all operand types are legal.
185 for (unsigned i = 0, NumOps = I->getNumOperands(); i < NumOps; ++i)
186 if (!isTypeLegal(I->getOperand(i).getValueType())) {
187 cerr << "Operand type " << i << " illegal!\n";
188 Failed = true;
189 }
190
191 if (I->getNodeId() != Processed) {
192 if (I->getNodeId() == NewNode)
193 cerr << "New node not 'noticed'?\n";
194 else if (I->getNodeId() > 0)
195 cerr << "Operand not processed?\n";
196 else if (I->getNodeId() == ReadyToProcess)
197 cerr << "Not added to worklist?\n";
198 Failed = true;
199 }
200
201 if (Failed) {
202 I->dump(&DAG); cerr << "\n";
203 abort();
204 }
187205 }
188206 #endif
189207 }