Skip to content

Commit 2a47f4a

Browse files
authored
[clang][CGExprScalar] Remove no-op ptr-to-ptr bitcast (NFC) (llvm#72072)
Remove bitcast added back in dcd7471 .
1 parent 0a0e06f commit 2a47f4a

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

clang/lib/CodeGen/CGExprScalar.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,18 +2224,8 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
22242224
return Visit(const_cast<Expr*>(E));
22252225

22262226
case CK_NoOp: {
2227-
llvm::Value *V = CE->changesVolatileQualification()
2228-
? EmitLoadOfLValue(CE)
2229-
: Visit(const_cast<Expr *>(E));
2230-
if (V) {
2231-
// CK_NoOp can model a pointer qualification conversion, which can remove
2232-
// an array bound and change the IR type.
2233-
// FIXME: Once pointee types are removed from IR, remove this.
2234-
llvm::Type *T = ConvertType(DestTy);
2235-
if (T != V->getType())
2236-
V = Builder.CreateBitCast(V, T);
2237-
}
2238-
return V;
2227+
return CE->changesVolatileQualification() ? EmitLoadOfLValue(CE)
2228+
: Visit(const_cast<Expr *>(E));
22392229
}
22402230

22412231
case CK_BaseToDerived: {

0 commit comments

Comments
 (0)