diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-05-12 11:07:40 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-05-12 11:07:40 +0000 |
commit | 5156f5b214bafc24e20ed49114b35ffbd55dc623 (patch) | |
tree | 2e4e97bb5bc5744fb80707c3a7003a428379c31e /lib/CodeGen/IntrinsicLowering.cpp | |
parent | 58d054783d0c6a0c313da91b91f8ba7c8137cefe (diff) |
Get the size of auto arrays right, regardless of its changing size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 72c0f3b084..12d392c09f 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/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); } |