ConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI.

Duplicate getOffset() call.

llvm-svn: 360515
This commit is contained in:
Simon Pilgrim 2019-05-11 11:01:46 +00:00
parent aeed0a30c0
commit 3ff9c51eba
1 changed files with 1 additions and 3 deletions

View File

@ -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<llvm::PointerType>(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);