aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorYoungsuk Kim <youngsuk.kim@hpe.com>2023-10-31 14:56:50 -0500
committerYoungsuk Kim <youngsuk.kim@hpe.com>2023-11-01 09:06:15 -0500
commitbc44e6e7c64ae7abd885fc31a62e37f649e307be (patch)
tree5099203231e8265e292cd2a2fd3311d784713f3f /clang/lib/CodeGen/CGDecl.cpp
parent008af1c9f4cd0188a69bf42b821749154a8142c8 (diff)
downloadllvm-bc44e6e7c64ae7abd885fc31a62e37f649e307be.zip
llvm-bc44e6e7c64ae7abd885fc31a62e37f649e307be.tar.gz
llvm-bc44e6e7c64ae7abd885fc31a62e37f649e307be.tar.bz2
[clang] Remove no-op ptr-to-ptr bitcasts (NFC)
Opaque pointer cleanup effort.
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 9e4319d..0420f43 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -386,9 +386,7 @@ CodeGenFunction::AddInitializerToStaticVarDecl(const VarDecl &D,
GV->takeName(OldGV);
// Replace all uses of the old global with the new global
- llvm::Constant *NewPtrForOldDecl =
- llvm::ConstantExpr::getBitCast(GV, OldGV->getType());
- OldGV->replaceAllUsesWith(NewPtrForOldDecl);
+ OldGV->replaceAllUsesWith(GV);
// Erase the old global, since it is no longer used.
OldGV->eraseFromParent();