Skip to content

Commit d8c4080

Browse files
committed
[clang][CGExprConstant] Remove no-op ptr-to-ptr bitcast (NFC)
Remove a call to `getPointerCast` which is effectively does a no-op ptr-to-ptr bitcast. Opaque ptr clean-up effort.
1 parent 4b1fe09 commit d8c4080

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

clang/lib/CodeGen/CGExprConstant.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,10 +1861,7 @@ class ConstantLValueEmitter : public ConstStmtVisitor<ConstantLValueEmitter,
18611861
if (!hasNonZeroOffset())
18621862
return C;
18631863

1864-
llvm::Type *origPtrTy = C->getType();
1865-
C = llvm::ConstantExpr::getGetElementPtr(CGM.Int8Ty, C, getOffset());
1866-
C = llvm::ConstantExpr::getPointerCast(C, origPtrTy);
1867-
return C;
1864+
return llvm::ConstantExpr::getGetElementPtr(CGM.Int8Ty, C, getOffset());
18681865
}
18691866
};
18701867

0 commit comments

Comments
 (0)