[llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Wed Jun 22 14:04:56 PDT 2005



Changes in directory llvm/lib/Target/SparcV9:

SparcV9BurgISel.cpp updated: 1.21 -> 1.22
---
Log message:

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.




---
Diffs of the changes:  (+12 -5)

 SparcV9BurgISel.cpp |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp
diff -u llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.21 llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.22
--- llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.21	Sun Jun 19 00:45:00 2005
+++ llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp	Wed Jun 22 16:04:42 2005
@@ -2881,11 +2881,18 @@
     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;
+    }
   }
 }
 






More information about the llvm-commits mailing list