diff options
author | John McCall <rjmccall@apple.com> | 2011-02-15 09:22:45 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-15 09:22:45 +0000 |
commit | 5936e33bf74dd6bf126ceee0f6169a2593d03a69 (patch) | |
tree | 3164dc30585d3d19d444998cfaed95b1530357c3 /lib/CodeGen/CGExpr.cpp | |
parent | 718b01d077748989f860bd21ee3402852ed0ed86 (diff) |
Assorted cleanup:
- Have CGM precompute a number of commonly-used types
- Have CGF copy that during initialization instead of recomputing them
- Use TBAA info when initializing a parameter variable
- Refactor the scalar ++/-- code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 9e3ed62731..049aeeeebb 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1387,9 +1387,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { } // Extend or truncate the index type to 32 or 64-bits. - if (!Idx->getType()->isIntegerTy(LLVMPointerWidth)) - Idx = Builder.CreateIntCast(Idx, IntPtrTy, - IdxSigned, "idxprom"); + if (Idx->getType() != IntPtrTy) + Idx = Builder.CreateIntCast(Idx, IntPtrTy, IdxSigned, "idxprom"); // FIXME: As llvm implements the object size checking, this can come out. if (CatchUndefined) { |