summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 47926d6cf0e..6684f4e5d1c 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -579,7 +579,11 @@ LLVM_DUMP_METHOD void MachineOperand::dump() const {
/// getAddrSpace - Return the LLVM IR address space number that this pointer
/// points into.
unsigned MachinePointerInfo::getAddrSpace() const {
- if (V.isNull() || V.is<const PseudoSourceValue*>()) return 0;
+ if (V.isNull()) return 0;
+
+ if (V.is<const PseudoSourceValue*>())
+ return V.get<const PseudoSourceValue*>()->getAddressSpace();
+
return cast<PointerType>(V.get<const Value*>()->getType())->getAddressSpace();
}
OpenPOWER on IntegriCloud