summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Sparc/SparcInternals.h4
-rw-r--r--llvm/lib/Target/Sparc/SparcRegInfo.cpp8
2 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Target/Sparc/SparcInternals.h b/llvm/lib/Target/Sparc/SparcInternals.h
index 1de5496cbfe..7f836c7a20f 100644
--- a/llvm/lib/Target/Sparc/SparcInternals.h
+++ b/llvm/lib/Target/Sparc/SparcInternals.h
@@ -415,9 +415,11 @@ public:
}
- // To obtain the return value contained in a CALL machine instruction
+ // To obtain the return value and the indirect call address (if any)
+ // contained in a CALL machine instruction
//
const Value * getCallInstRetVal(const MachineInstr *CallMI) const;
+ const Value * getCallInstIndirectAddrVal(const MachineInstr *CallMI) const;
// The following methods are used to generate "copy" machine instructions
diff --git a/llvm/lib/Target/Sparc/SparcRegInfo.cpp b/llvm/lib/Target/Sparc/SparcRegInfo.cpp
index 9a3c7bd0b5f..434816e0a6b 100644
--- a/llvm/lib/Target/Sparc/SparcRegInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcRegInfo.cpp
@@ -93,6 +93,7 @@ unsigned UltraSparcRegInfo::getStackPointer() const {
//---------------------------------------------------------------------------
// Finds the return value of a sparc specific call instruction
//---------------------------------------------------------------------------
+
const Value *
UltraSparcRegInfo::getCallInstRetVal(const MachineInstr *CallMI) const {
unsigned OpCode = CallMI->getOpCode();
@@ -121,6 +122,13 @@ UltraSparcRegInfo::getCallInstRetVal(const MachineInstr *CallMI) const {
}
+const Value *
+UltraSparcRegInfo::getCallInstIndirectAddrVal(const MachineInstr *CallMI) const
+{
+ return (CallMI->getOpCode() == JMPLCALL)?
+ CallMI->getOperand(0).getVRegValue() : NULL;
+}
+
//---------------------------------------------------------------------------
// Finds the return address of a call sparc specific call instruction
OpenPOWER on IntegriCloud