Unverified Commit 2a47f4ae authored by Youngsuk Kim's avatar Youngsuk Kim Committed by GitHub
Browse files

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

Remove bitcast added back in dcd74716 .
parent 0a0e06f2
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -2224,18 +2224,8 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
    return Visit(const_cast<Expr*>(E));

  case CK_NoOp: {
    llvm::Value *V = CE->changesVolatileQualification()
                         ? EmitLoadOfLValue(CE)
    return 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;
  }

  case CK_BaseToDerived: {