mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Print physreg register nodes with target names (e.g. F1) instead of numbers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22934 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0189197608
commit
7228aa7868
@ -2070,7 +2070,11 @@ void SDNode::dump(const SelectionDAG *G) const {
|
||||
std::cerr << LBB->getName() << " ";
|
||||
std::cerr << (const void*)BBDN->getBasicBlock() << ">";
|
||||
} else if (const RegisterSDNode *C2V = dyn_cast<RegisterSDNode>(this)) {
|
||||
std::cerr << " #" << C2V->getReg();
|
||||
if (G && MRegisterInfo::isPhysicalRegister(R->getReg())) {
|
||||
std::cerr << " " <<G->getTarget().getRegisterInfo()->getName(R->getReg());
|
||||
} else {
|
||||
std::cerr << " #" << R->getReg();
|
||||
}
|
||||
} else if (const ExternalSymbolSDNode *ES =
|
||||
dyn_cast<ExternalSymbolSDNode>(this)) {
|
||||
std::cerr << "'" << ES->getSymbol() << "'";
|
||||
|
@ -13,6 +13,8 @@
|
||||
|
||||
#include "llvm/CodeGen/SelectionDAG.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/Target/MRegisterInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/Support/GraphWriter.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
@ -73,7 +75,11 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
|
||||
Op += LBB->getName();
|
||||
//Op += " " + (const void*)BBDN->getBasicBlock();
|
||||
} else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(Node)) {
|
||||
if (G && MRegisterInfo::isPhysicalRegister(R->getReg())) {
|
||||
Op = Op + " " + G->getTarget().getRegisterInfo()->getName(R->getReg());
|
||||
} else {
|
||||
Op += " #" + utostr(R->getReg());
|
||||
}
|
||||
} else if (const ExternalSymbolSDNode *ES =
|
||||
dyn_cast<ExternalSymbolSDNode>(Node)) {
|
||||
Op += "'" + std::string(ES->getSymbol()) + "'";
|
||||
|
Loading…
Reference in New Issue
Block a user