From 2a47f4ae457b80475058db356d4c0014d5f7f68c Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Mon, 13 Nov 2023 10:06:39 -0500 Subject: [clang][CGExprScalar] Remove no-op ptr-to-ptr bitcast (NFC) (#72072) Remove bitcast added back in dcd74716f9d18 . --- clang/lib/CodeGen/CGExprScalar.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 05a3c80..3784373 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -2224,18 +2224,8 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { return Visit(const_cast(E)); case CK_NoOp: { - llvm::Value *V = CE->changesVolatileQualification() - ? EmitLoadOfLValue(CE) - : Visit(const_cast(E)); - if (V) { - // CK_NoOp can model a pointer qualification conversion, which can remove - // an array bound and change the IR type. - // FIXME: Once pointee types are removed from IR, remove this. - llvm::Type *T = ConvertType(DestTy); - if (T != V->getType()) - V = Builder.CreateBitCast(V, T); - } - return V; + return CE->changesVolatileQualification() ? EmitLoadOfLValue(CE) + : Visit(const_cast(E)); } case CK_BaseToDerived: { -- cgit v1.1