summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCISelLowering.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-03-10 17:45:15 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-03-10 17:45:15 +0000
commitea5b2dd11c0526581803e7eb58224a2eabf191e6 (patch)
tree231646bba785a129b3a2d409badb74e7ccd1594c /lib/Target/PowerPC/PPCISelLowering.cpp
parentf5a3459adfde823bc7617f8ecfdd9fbc5a1ffadf (diff)
downloadsrc-test2-ea5b2dd11c0526581803e7eb58224a2eabf191e6.tar.gz
src-test2-ea5b2dd11c0526581803e7eb58224a2eabf191e6.zip
Notes
Diffstat (limited to 'lib/Target/PowerPC/PPCISelLowering.cpp')
-rw-r--r--lib/Target/PowerPC/PPCISelLowering.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp
index 3d81afa45078..aeaa7c6816d8 100644
--- a/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -3258,6 +3258,16 @@ PPCTargetLowering::LowerCall_Darwin(SDValue Chain, SDValue Callee,
false, false, 0);
}
+ // On Darwin, R12 must contain the address of an indirect callee. This does
+ // not mean the MTCTR instruction must use R12; it's easier to model this as
+ // an extra parameter, so do that.
+ if (!isTailCall &&
+ !dyn_cast<GlobalAddressSDNode>(Callee) &&
+ !dyn_cast<ExternalSymbolSDNode>(Callee) &&
+ !isBLACompatibleAddress(Callee, DAG))
+ RegsToPass.push_back(std::make_pair((unsigned)(isPPC64 ? PPC::X12 :
+ PPC::R12), Callee));
+
// Build a sequence of copy-to-reg nodes chained together with token chain
// and flag operands which copy the outgoing args into the appropriate regs.
SDValue InFlag;