Skip to content

Commit

Permalink
[CodeGenModule] Remove no-op ptr-to-ptr bitcasts (NFC)
Browse files Browse the repository at this point in the history
Opaque ptr cleanup effort (NFC)
  • Loading branch information
JOE1994 committed Nov 20, 2023
1 parent 3e6d629 commit ed73121
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions clang/lib/CodeGen/CodeGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1983,9 +1983,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) {
for (const auto &I : Fns) {
auto ctor = ctors.beginStruct(CtorStructTy);
ctor.addInt(Int32Ty, I.Priority);
ctor.add(llvm::ConstantExpr::getBitCast(I.Initializer, CtorPFTy));
ctor.add(I.Initializer);
if (I.AssociatedData)
ctor.add(llvm::ConstantExpr::getBitCast(I.AssociatedData, VoidPtrTy));
ctor.add(I.AssociatedData);
else
ctor.addNullPointer(VoidPtrTy);
ctor.finishAndAddTo(ctors);
Expand Down Expand Up @@ -4555,9 +4555,7 @@ llvm::Constant *CodeGenModule::GetFunctionStart(const ValueDecl *Decl) {
llvm::GlobalValue *F =
cast<llvm::GlobalValue>(GetAddrOfFunction(Decl)->stripPointerCasts());

return llvm::ConstantExpr::getBitCast(
llvm::NoCFIValue::get(F),
llvm::PointerType::get(VMContext, F->getAddressSpace()));
return llvm::NoCFIValue::get(F);
}

static const FunctionDecl *
Expand Down

0 comments on commit ed73121

Please sign in to comment.