Skip to content

Commit ed73121

Browse files
committed
[CodeGenModule] Remove no-op ptr-to-ptr bitcasts (NFC)
Opaque ptr cleanup effort (NFC)
1 parent 3e6d629 commit ed73121

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,9 +1983,9 @@ void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) {
19831983
for (const auto &I : Fns) {
19841984
auto ctor = ctors.beginStruct(CtorStructTy);
19851985
ctor.addInt(Int32Ty, I.Priority);
1986-
ctor.add(llvm::ConstantExpr::getBitCast(I.Initializer, CtorPFTy));
1986+
ctor.add(I.Initializer);
19871987
if (I.AssociatedData)
1988-
ctor.add(llvm::ConstantExpr::getBitCast(I.AssociatedData, VoidPtrTy));
1988+
ctor.add(I.AssociatedData);
19891989
else
19901990
ctor.addNullPointer(VoidPtrTy);
19911991
ctor.finishAndAddTo(ctors);
@@ -4555,9 +4555,7 @@ llvm::Constant *CodeGenModule::GetFunctionStart(const ValueDecl *Decl) {
45554555
llvm::GlobalValue *F =
45564556
cast<llvm::GlobalValue>(GetAddrOfFunction(Decl)->stripPointerCasts());
45574557

4558-
return llvm::ConstantExpr::getBitCast(
4559-
llvm::NoCFIValue::get(F),
4560-
llvm::PointerType::get(VMContext, F->getAddressSpace()));
4558+
return llvm::NoCFIValue::get(F);
45614559
}
45624560

45634561
static const FunctionDecl *

0 commit comments

Comments
 (0)