diff options
| author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-04-24 02:40:57 +0000 |
|---|---|---|
| committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-04-24 02:40:57 +0000 |
| commit | 7cabee5b18212bd3106aea8415b044b2b3b43518 (patch) | |
| tree | 615cd12617b831b55b1aecfec679e7f82b91748b /lib/CodeGen/CGExpr.cpp | |
| parent | 6a3b29e29b7b7653fb55b1376ca5e74ad7731b17 (diff) | |
| download | clang-7cabee5b18212bd3106aea8415b044b2b3b43518.tar.gz clang-7cabee5b18212bd3106aea8415b044b2b3b43518.tar.bz2 clang-7cabee5b18212bd3106aea8415b044b2b3b43518.tar.xz | |
Clang part of r69947. Reverting back 69574 as it is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69949 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index ed1baa0da0..f155139e51 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -805,11 +805,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { QualType IdxTy = E->getIdx()->getType(); bool IdxSigned = IdxTy->isSignedIntegerType(); unsigned IdxBitwidth = cast<llvm::IntegerType>(Idx->getType())->getBitWidth(); - - // If Pointer width is less than 32 than extend to 32. - unsigned IdxValidWidth = (LLVMPointerWidth < 32 ) ? 32 : LLVMPointerWidth; - if (IdxBitwidth != IdxValidWidth) - Idx = Builder.CreateIntCast(Idx, llvm::IntegerType::get(IdxValidWidth), + if (IdxBitwidth != LLVMPointerWidth) + Idx = Builder.CreateIntCast(Idx, llvm::IntegerType::get(LLVMPointerWidth), IdxSigned, "idxprom"); // We know that the pointer points to a type of the correct size, unless the |
