Print out opcode number if it's an unknown target node.

llvm-svn: 24869
This commit is contained in:
Evan Cheng 2005-12-19 23:11:49 +00:00
parent 19b9f15377
commit 9fd9541367
1 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/ADT/StringExtras.h"
#include <iostream>
#include <set>
#include <cmath>
@ -1838,7 +1839,11 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
if (const TargetInstrInfo *TII = G->getTarget().getInstrInfo())
if (getOpcode()-ISD::BUILTIN_OP_END < TII->getNumOpcodes())
return TII->getName(getOpcode()-ISD::BUILTIN_OP_END);
return "<<Unknown Target Node>>";
std::string Name
= "<<Unknown Target Node:"
+ itostr((int)getOpcode()-ISD::BUILTIN_OP_END) + ">>";
return Name.c_str();
}
case ISD::PCMARKER: return "PCMarker";