[swift-dev] Compiling SIL with swiftc

Joe Groff jgroff at apple.com
Thu Dec 31 11:31:58 CST 2015


> On Dec 31, 2015, at 2:33 AM, Luke Howard via swift-dev <swift-dev at swift.org> wrote:
> 
> Newbie question, is the following supposed to work?
> 
> $ ./swiftc -emit-sil -o lookup.sil lookup.swift
> $ ./swiftc -parse-sil -o lookup lookup.sil
> 
> It fails with a gazillion errors:
> 
> lookup.sil:61:25: error: use of undeclared type 'SomeProtocol'
>   %23 = metatype $@thin SomeProtocol.Protocol
>                         ^~~~~~~~~~~~
> lookup.sil:62:3: error: expressions are not allowed at the top level
>   %24 = metatype $@thick SomeProtocol.Protocol    // user: %25
>   ^
> lookup.sil:62:17: error: consecutive statements on a line must be separated by ';'
>   %24 = metatype $@thick SomeProtocol.Protocol    // user: %25
>                 ^
>                 ;
> ...
> 
> almost as if it thinks it’s Swift.

This should work. I think, though, that if you try to compile multiple files together, it currently parses them all as .swift files, which might explain the failure.

-Joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20151231/55828506/attachment.html>


More information about the swift-dev mailing list