mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SILGen: Emit "main" as a SIL function.
Eliminate the intermediate top_level_code function. Now that SIL is expressive enough to express a "main" function, there's no reason for it, and this eliminates a bunch of mystery code in IRGen to thunk from main to top_level_code by reaching for hardcoded symbol names. Demystify the special code for setting up C_ARGC and C_ARGV by having SILGen look for a transparent "_didEnterMain" hook in the stdlib and emit a call to it. Swift SVN r22525
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
func main() {
|
||||
// CHECK: call void @llvm.dbg.declare(metadata !{%"protocol<>"* {{.*}}}, metadata ![[S:.*]], metadata !{{[0-9]+}}), !dbg ![[DBG:.*]]
|
||||
// CHECK: ![[S]] ={{.*}}[ DW_TAG_auto_variable ] [s] [line [[@LINE+3]]]
|
||||
// CHECK: ![[SCOPE:.*]] = metadata !{metadata !"0xb\002\0013\000"{{.*}}} ; [ DW_TAG_lexical_block ]
|
||||
// CHECK: ![[SCOPE:.*]] = metadata !{metadata !"0xb\002\0013\001"{{.*}}} ; [ DW_TAG_lexical_block ]
|
||||
// CHECK: ![[DBG]] = metadata !{i32 [[@LINE+1]], i32 6, metadata ![[SCOPE]], null}
|
||||
var s : Any = "hello world"
|
||||
var n : Any = 12
|
||||
|
||||
Reference in New Issue
Block a user