mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
print arbitrary constant pool entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26545 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9176b0169c
commit
5267651057
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "llvm/CodeGen/SelectionDAG.h"
|
#include "llvm/CodeGen/SelectionDAG.h"
|
||||||
#include "llvm/CodeGen/MachineFunction.h"
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
#include "llvm/Target/MRegisterInfo.h"
|
#include "llvm/Target/MRegisterInfo.h"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
#include "llvm/Config/config.h"
|
#include "llvm/Config/config.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
@ -81,6 +83,13 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
|
|||||||
} else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Node)){
|
} else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Node)){
|
||||||
if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->get()))
|
if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->get()))
|
||||||
Op += "<" + ftostr(CFP->getValue()) + ">";
|
Op += "<" + ftostr(CFP->getValue()) + ">";
|
||||||
|
else if (ConstantInt *CI = dyn_cast<ConstantInt>(CP->get()))
|
||||||
|
Op += "<" + utostr(CI->getZExtValue()) + ">";
|
||||||
|
else {
|
||||||
|
std::ostringstream SS;
|
||||||
|
WriteAsOperand(SS, CP->get(), false);
|
||||||
|
Op += "<" + SS.str() + ">";
|
||||||
|
}
|
||||||
} else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(Node)) {
|
} else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(Node)) {
|
||||||
Op = "BB: ";
|
Op = "BB: ";
|
||||||
const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock();
|
const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user