mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Added support for machine specific constantpool values. These are useful for
representing expressions that can only be resolved at link time, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30278 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/CodeGen/SelectionDAG.h"
|
||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/Target/MRegisterInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
@@ -80,14 +81,20 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
|
||||
} else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(Node)) {
|
||||
Op += " " + itostr(FIDN->getIndex());
|
||||
} else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Node)){
|
||||
if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->get()))
|
||||
Op += "<" + ftostr(CFP->getValue()) + ">";
|
||||
else if (ConstantInt *CI = dyn_cast<ConstantInt>(CP->get()))
|
||||
Op += "<" + utostr(CI->getZExtValue()) + ">";
|
||||
else {
|
||||
if (CP->isMachineConstantPoolEntry()) {
|
||||
std::ostringstream SS;
|
||||
WriteAsOperand(SS, CP->get(), false);
|
||||
CP->getMachineCPVal()->print(SS);
|
||||
Op += "<" + SS.str() + ">";
|
||||
} else {
|
||||
if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->getConstVal()))
|
||||
Op += "<" + ftostr(CFP->getValue()) + ">";
|
||||
else if (ConstantInt *CI = dyn_cast<ConstantInt>(CP->getConstVal()))
|
||||
Op += "<" + utostr(CI->getZExtValue()) + ">";
|
||||
else {
|
||||
std::ostringstream SS;
|
||||
WriteAsOperand(SS, CP->getConstVal(), false);
|
||||
Op += "<" + SS.str() + ">";
|
||||
}
|
||||
}
|
||||
} else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(Node)) {
|
||||
Op = "BB: ";
|
||||
|
||||
Reference in New Issue
Block a user