Skip to content

Commit ffa5898

Browse files
Merge pull request #10671 from aschwaighofer/fix_irgen_master_next_emitEagerClassInitialization
IRGen: Add the created LLVM function to the current module before the call to the IRGenFunction constructor
2 parents 56debbc + c9ef553 commit ffa5898

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)