summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IntrinsicLowering.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-05-12 11:07:40 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-05-12 11:07:40 +0000
commitbf283708f7a961db8862a884dfb4b912b89ba818 (patch)
treeddd3dc98c1e691a7bd8190cd374dd08bcc9d7a76 /llvm/lib/CodeGen/IntrinsicLowering.cpp
parentece86af25983a61f6f26f99c60ce45975eea6bf3 (diff)
downloadbcm5719-llvm-bf283708f7a961db8862a884dfb4b912b89ba818.tar.gz
bcm5719-llvm-bf283708f7a961db8862a884dfb4b912b89ba818.zip
Get the size of auto arrays right, regardless of its changing size.
llvm-svn: 37006
Diffstat (limited to 'llvm/lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/IntrinsicLowering.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp
index 72c0f3b084a..12d392c09f0 100644
--- a/llvm/lib/CodeGen/IntrinsicLowering.cpp
+++ b/llvm/lib/CodeGen/IntrinsicLowering.cpp
@@ -403,11 +403,12 @@ static Instruction *LowerPartSelect(CallInst *CI) {
}
// 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 @@ static Instruction *LowerPartSet(CallInst *CI) {
}
// 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);
}
OpenPOWER on IntegriCloud