aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorYoungsuk Kim <joseph942010@gmail.com>2023-11-13 10:06:39 -0500
committerGitHub <noreply@github.com>2023-11-13 10:06:39 -0500
commit2a47f4ae457b80475058db356d4c0014d5f7f68c (patch)
tree2e74315920906bc41687f710d454fb30c2865823 /clang/lib/CodeGen
parent0a0e06f29145213e90de88ca39f7b505ce092a4a (diff)
downloadllvm-2a47f4ae457b80475058db356d4c0014d5f7f68c.zip
llvm-2a47f4ae457b80475058db356d4c0014d5f7f68c.tar.gz
llvm-2a47f4ae457b80475058db356d4c0014d5f7f68c.tar.bz2
[clang][CGExprScalar] Remove no-op ptr-to-ptr bitcast (NFC) (#72072)
Remove bitcast added back in dcd74716f9d18 .
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp14
1 files changed, 2 insertions, 12 deletions
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<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: {