summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-04-29 04:43:24 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-04-29 04:43:24 +0000
commitccd30945f9b3fedbb1596f3098b07dc95510ff97 (patch)
tree871cba6c4e32fdfcae397d8935ae00b58a3719b8 /llvm/lib
parente525dc3c6601596d8570115cb0567c6c2dc69e40 (diff)
downloadbcm5719-llvm-ccd30945f9b3fedbb1596f3098b07dc95510ff97.tar.gz
bcm5719-llvm-ccd30945f9b3fedbb1596f3098b07dc95510ff97.zip
Add a public method called getAddressSpace() to the GlobalAddressSDNode.
llvm-svn: 70366
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
-rw-r--r--llvm/lib/Target/PIC16/PIC16ISelLowering.cpp3
2 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 7c9a00135a1..1c85e9d743e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5649,6 +5649,13 @@ void SDNode::dumpr() const {
DumpNodesr(errs(), this, 0, 0, once);
}
+
+// getAddressSpace - Return the address space this GlobalAddress belongs to.
+unsigned GlobalAddressSDNode::getAddressSpace() const {
+ return getGlobal()->getType()->getAddressSpace();
+}
+
+
const Type *ConstantPoolSDNode::getType() const {
if (isMachineConstantPoolEntry())
return Val.MachineCPVal->getType();
diff --git a/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp b/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp
index 87753f98c55..b817d05c05f 100644
--- a/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp
+++ b/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp
@@ -483,9 +483,8 @@ bool PIC16TargetLowering::isRomAddress(const SDValue &Op) {
// It is BUILD_PAIR((PIC16Lo TGA), (PIC16Hi TGA)) and Op is BUILD_PAIR
SDValue TGA = Op.getOperand(0).getOperand(0);
GlobalAddressSDNode *GSDN = dyn_cast<GlobalAddressSDNode>(TGA);
- int AddrSpace = GSDN->getGlobal()->getType()->getAddressSpace();
- if (AddrSpace == PIC16ISD::ROM_SPACE)
+ if (GSDN->getAddressSpace() == PIC16ISD::ROM_SPACE)
return true;
// Any other address space return it false
OpenPOWER on IntegriCloud