[clang] [clang][CGExprScalar] Remove no-op ptr-to-ptr bitcast (NFC) (PR #72072)

Youngsuk Kim via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 07:04:52 PST 2023


================
@@ -2227,14 +2227,6 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
     llvm::Value *V = CE->changesVolatileQualification()
                          ? EmitLoadOfLValue(CE)
                          : Visit(const_cast<Expr *>(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;
----------------
JOE1994 wrote:

I added a follow-up commit for this. Thank you!

https://github.com/llvm/llvm-project/pull/72072


More information about the cfe-commits mailing list