Skip to content

Commit 0bedd20

Browse files
committed
IRGen: Emit hoisted declarations at the top level
1 parent b9cd6ca commit 0bedd20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,15 @@ void IRGenModule::emitSourceFile(SourceFile &SF) {
449449
// Emit types and other global decls.
450450
for (auto *decl : SF.getTopLevelDecls())
451451
emitGlobalDecl(decl);
452+
for (auto *decl : SF.getHoistedDecls())
453+
emitGlobalDecl(decl);
452454
for (auto *localDecl : SF.LocalTypeDecls)
453455
emitGlobalDecl(localDecl);
454456
for (auto *opaqueDecl : SF.getOpaqueReturnTypeDecls())
455457
maybeEmitOpaqueTypeDecl(opaqueDecl);
456458

457459
SF.collectLinkLibraries([this](LinkLibrary linkLib) {
458-
this->addLinkLibrary(linkLib);
460+
this->addLinkLibrary(linkLib);
459461
});
460462

461463
if (ObjCInterop)

0 commit comments

Comments
 (0)