summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2005-06-22 21:04:42 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2005-06-22 21:04:42 +0000
commit253145299b3f165522ed2a85a837ed22c38825c6 (patch)
treee235960070b7041774c81f488f21da10da033e22 /llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp
parent5305ea5c86345414a14db97d9dfc8775dfc80e1f (diff)
downloadbcm5719-llvm-253145299b3f165522ed2a85a837ed22c38825c6.tar.gz
bcm5719-llvm-253145299b3f165522ed2a85a837ed22c38825c6.zip
If we support structs as va_list, we must pass pointers to them to va_copy
See last commit for LangRef, this implements it on all targets. llvm-svn: 22273
Diffstat (limited to 'llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp')
-rw-r--r--llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp b/llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp
index cc2c81f3bb7..a6722b1862f 100644
--- a/llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp
+++ b/llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp
@@ -2881,11 +2881,18 @@ static bool CodeGenIntrinsic(Intrinsic::ID iid, CallInst &callInstr,
return true; // no-op on SparcV9
case Intrinsic::vacopy:
- // Simple store of current va_list (arg2) to new va_list (arg1)
- mvec.push_back(BuildMI(V9::STXi, 3).
- addReg(callInstr.getOperand(2)).
- addReg(callInstr.getOperand(1)).addSImm(0));
- return true;
+ {
+ MachineCodeForInstruction& m1 = MachineCodeForInstruction::get(&callInstr);
+ TmpInstruction* VReg =
+ new TmpInstruction(m1, callInstr.getOperand(1)->getType());
+
+ // Simple store of current va_list (arg2) to new va_list (arg1)
+ mvec.push_back(BuildMI(V9::LDXi, 3).
+ addReg(callInstr.getOperand(2)).addSImm(0).addRegDef(VReg));
+ mvec.push_back(BuildMI(V9::STXi, 3).
+ addReg(VReg).addReg(callInstr.getOperand(1)).addSImm(0));
+ return true;
+ }
}
}
OpenPOWER on IntegriCloud