summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-15 09:22:45 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-15 09:22:45 +0000
commite3dc1707b530dd264417390f1510c99c166eb103 (patch)
tree930defae9890f4e57bda489693591a534d17341e /clang/lib/CodeGen/CGExpr.cpp
parentcd3858b103195a2fa1ff2a5221e34d0680584c73 (diff)
downloadbcm5719-llvm-e3dc1707b530dd264417390f1510c99c166eb103.tar.gz
bcm5719-llvm-e3dc1707b530dd264417390f1510c99c166eb103.zip
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 llvm-svn: 125562
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 9e3ed627310..049aeeeebb8 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud