Skip to content

Commit 4b40481

Browse files
authored
Merge pull request #70563 from kubamracek/embedded-no-entry-point
[embedded] Do not emit entry point data (__swift5_entry) in embedded Swift
2 parents 18ed193 + 282e651 commit 4b40481

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,6 +2245,10 @@ static std::string getEntryPointSection(IRGenModule &IGM) {
22452245
}
22462246

22472247
void IRGenerator::emitEntryPointInfo() {
2248+
if (SIL.getOptions().EmbeddedSwift) {
2249+
return;
2250+
}
2251+
22482252
SILFunction *entrypoint = nullptr;
22492253
if (!(entrypoint = SIL.lookUpFunction(
22502254
SIL.getASTContext().getEntryPointFunctionName()))) {

test/embedded/internalize-no-stdlib.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ public func main() {
2525
start(p: Concrete())
2626
}
2727

28-
// CHECK-ELF: @"\01l_entry_point" =
2928
// CHECK-ELF: @__swift_reflection_version =
3029
// CHECK-ELF: @_swift1_autolink_entries =
31-
// CHECK-ELF: @llvm.compiler.used = appending global [3 x ptr] [ptr @"\01l_entry_point", ptr @__swift_reflection_version, ptr @_swift1_autolink_entries], section "llvm.metadata"
30+
// CHECK-ELF: @llvm.compiler.used = appending global [2 x ptr] [ptr @__swift_reflection_version, ptr @_swift1_autolink_entries], section "llvm.metadata"
3231
// CHECK-ELF-NOT: @llvm.used
3332

34-
// CHECK-MACHO: @"\01l_entry_point" =
3533
// CHECK-MACHO: @__swift_reflection_version =
3634
// CHECK-MACHO-NOT: @llvm.compiler.used
37-
// CHECK-MACHO: @llvm.used = appending global [2 x ptr] [ptr @"\01l_entry_point", ptr @__swift_reflection_version], section "llvm.metadata"
35+
// CHECK-MACHO: @llvm.used = appending global [1 x ptr] [ptr @__swift_reflection_version], section "llvm.metadata"

0 commit comments

Comments
 (0)