[llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp

Reid Spencer reid at x10sys.com
Sat May 12 04:07:57 PDT 2007



Changes in directory llvm/lib/CodeGen:

IntrinsicLowering.cpp updated: 1.81 -> 1.82
---
Log message:

Get the size of auto arrays right, regardless of its changing size.


---
Diffs of the changes:  (+13 -11)

 IntrinsicLowering.cpp |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)


Index: llvm/lib/CodeGen/IntrinsicLowering.cpp
diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.81 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.82
--- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.81	Mon Apr 16 17:21:14 2007
+++ llvm/lib/CodeGen/IntrinsicLowering.cpp	Sat May 12 06:07:40 2007
@@ -403,11 +403,12 @@
   }
 
   // Return a call to the implementation function
-  Value *Args[3];
-  Args[0] = CI->getOperand(1);
-  Args[1] = CI->getOperand(2);
-  Args[2] = CI->getOperand(3);
-  return new CallInst(F, Args, 3, CI->getName(), CI);
+  Value *Args[] = {
+    CI->getOperand(1),
+    CI->getOperand(2),
+    CI->getOperand(3)
+  };
+  return new CallInst(F, Args, sizeof(Args)/sizeof(Args[0]), CI->getName(), CI);
 }
 
 /// Convert the llvm.part.set.iX.iY.iZ intrinsic. This intrinsic takes 
@@ -591,12 +592,13 @@
   }
 
   // Return a call to the implementation function
-  Value *Args[3];
-  Args[0] = CI->getOperand(1);
-  Args[1] = CI->getOperand(2);
-  Args[2] = CI->getOperand(3);
-  Args[3] = CI->getOperand(4);
-  return new CallInst(F, Args, 4, CI->getName(), CI);
+  Value *Args[] = {
+    CI->getOperand(1),
+    CI->getOperand(2),
+    CI->getOperand(3),
+    CI->getOperand(4)
+  };
+  return new CallInst(F, Args, sizeof(Args)/sizeof(Args[0]), CI->getName(), CI);
 }
 
 






More information about the llvm-commits mailing list