aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGClass.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-05-06 06:35:23 +0000
committerChris Lattner <sabre@nondot.org>2010-05-06 06:35:23 +0000
commit985f73960ac76842da4b10c30ca87a282ff9aa31 (patch)
treee71e7707fdd54ec7eb2d54d16ef6c67043ee643a /lib/CodeGen/CGClass.cpp
parent58ae5b4b1e2fc02b95d6650af5755a59639aa153 (diff)
simplify EmitAggMemberInitializer a bit and make it work in 32-bit mode,
fixing PR7063. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103171 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGClass.cpp')
-rw-r--r--lib/CodeGen/CGClass.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
index f3f4d42478..72d95b8556 100644
--- a/lib/CodeGen/CGClass.cpp
+++ b/lib/CodeGen/CGClass.cpp
@@ -397,10 +397,9 @@ static void EmitAggMemberInitializer(CodeGenFunction &CGF,
// Generate: if (loop-index < number-of-elements) fall to the loop body,
// otherwise, go to the block after the for-loop.
uint64_t NumElements = Array->getSize().getZExtValue();
- llvm::Value * NumElementsPtr =
- llvm::ConstantInt::get(llvm::Type::getInt64Ty(CGF.getLLVMContext()),
- NumElements);
llvm::Value *Counter = CGF.Builder.CreateLoad(IndexVar);
+ llvm::Value *NumElementsPtr =
+ llvm::ConstantInt::get(Counter->getType(), NumElements);
llvm::Value *IsLess = CGF.Builder.CreateICmpULT(Counter, NumElementsPtr,
"isless");