Skip to content

Commit

Permalink
[clang][CGExprScalar] Remove no-op ptr-to-ptr bitcast (NFC) (#72072)
Browse files Browse the repository at this point in the history
Remove bitcast added back in dcd7471 .
  • Loading branch information
JOE1994 committed Nov 13, 2023
1 parent 0a0e06f commit 2a47f4a
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions clang/lib/CodeGen/CGExprScalar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
: 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;
return CE->changesVolatileQualification() ? EmitLoadOfLValue(CE)
: Visit(const_cast<Expr *>(E));
}

case CK_BaseToDerived: {
Expand Down

0 comments on commit 2a47f4a

Please sign in to comment.