Skip to content

Commit c9ef553

Browse files
committed
IRGen: Add the created LLVM function to the current module before the call to the
IRGenFunction() constructor A change in LLVM will require the function to have a module parent when we insert the epilogue alloca in the IRGenFunction constructor. rdar://32998781
1 parent b115ae5 commit c9ef553

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,9 +959,9 @@ void IRGenerator::emitEagerClassInitialization() {
959959
llvm::FunctionType::get(IGM->VoidTy, false),
960960
llvm::GlobalValue::PrivateLinkage,
961961
"_swift_eager_class_initialization");
962+
IGM->Module.getFunctionList().push_back(RegisterFn);
962963
IRGenFunction RegisterIGF(*IGM, RegisterFn);
963964
RegisterFn->setAttributes(IGM->constructInitialAttributes());
964-
IGM->Module.getFunctionList().push_back(RegisterFn);
965965
RegisterFn->setCallingConv(IGM->DefaultCC);
966966

967967
for (ClassDecl *CD : ClassesForEagerInitialization) {

0 commit comments

Comments
 (0)