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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24869 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2005-12-19 23:11:49 +00:00
parent f9fc25db32
commit 115c036a4c

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";