From: Simon Pilgrim Date: Sat, 11 May 2019 11:01:46 +0000 (+0000) Subject: ConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bb42abb270b5879a3acd289ca42341115a3cb46;p=clang ConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI. Duplicate getOffset() call. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360515 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 4c0256fe38..11d344ffe9 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -1695,8 +1695,6 @@ llvm::Constant *ConstantLValueEmitter::tryEmit() { /// bitcast to pointer type. llvm::Constant * ConstantLValueEmitter::tryEmitAbsolute(llvm::Type *destTy) { - auto offset = getOffset(); - // If we're producing a pointer, this is easy. auto destPtrTy = cast(destTy); if (Value.isNullPointer()) { @@ -1708,7 +1706,7 @@ ConstantLValueEmitter::tryEmitAbsolute(llvm::Type *destTy) { // to a pointer. // FIXME: signedness depends on the original integer type. auto intptrTy = CGM.getDataLayout().getIntPtrType(destPtrTy); - llvm::Constant *C = offset; + llvm::Constant *C; C = llvm::ConstantExpr::getIntegerCast(getOffset(), intptrTy, /*isSigned*/ false); C = llvm::ConstantExpr::getIntToPtr(C, destPtrTy);