Swiftc and -parse-sil?

The swift compiler has an option '-parse-sil' which could previously be used to parse SIL code. However, it looks like the swift compiler is assuming it's still Swift code:

$ echo "sil_stage canonical" | xcrun swiftc -parse-sil -
<stdin>:1:10: error: consecutive statements on a line must be separated by ';'
sil_stage canonical
         ^
         ;
<stdin>:1:1: error: use of unresolved identifier 'sil_stage'
sil_stage canonical
^~~~~~~~~
<stdin>:1:11: error: use of unresolved identifier 'canonical'
sil_stage canonical
          ^~~~~~~~~
A similar message was posted to the list at the end of last year, indicating that it should work: [swift-dev] Compiling SIL with swiftc but no indication that there was a bug raised or fixed at the time.

Is this a known issue or should I rase a bug?

Alex

The swift compiler has an option '-parse-sil' which could previously be used to parse SIL code. However, it looks like the swift compiler is assuming it's still Swift code:

I just opened a PR with a very minimal fix: Fix -parse-sil for filenames not ending in .sil. by rudkx · Pull Request #5345 · apple/swift · GitHub

The problem is that it was still looking for a filename ending in ‘.sil’ even with -parse-sil specified.

Mark

···

On Oct 18, 2016, at 3:43 AM, Alex Blewitt via swift-dev <swift-dev@swift.org> wrote:

$ echo "sil_stage canonical" | xcrun swiftc -parse-sil -
<stdin>:1:10: error: consecutive statements on a line must be separated by ';'
sil_stage canonical
         ^
         ;
<stdin>:1:1: error: use of unresolved identifier 'sil_stage'
sil_stage canonical
^~~~~~~~~
<stdin>:1:11: error: use of unresolved identifier 'canonical'
sil_stage canonical
          ^~~~~~~~~
A similar message was posted to the list at the end of last year, indicating that it should work: [swift-dev] Compiling SIL with swiftc but no indication that there was a bug raised or fixed at the time.

Is this a known issue or should I rase a bug?

Alex
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Nice, thanks.

···

On 18 Oct 2016, at 14:58, Mark Lacey <mark.lacey@apple.com> wrote:

On Oct 18, 2016, at 3:43 AM, Alex Blewitt via swift-dev <swift-dev@swift.org <mailto:swift-dev@swift.org>> wrote:

The swift compiler has an option '-parse-sil' which could previously be used to parse SIL code. However, it looks like the swift compiler is assuming it's still Swift code:

I just opened a PR with a very minimal fix: Fix -parse-sil for filenames not ending in .sil. by rudkx · Pull Request #5345 · apple/swift · GitHub

The problem is that it was still looking for a filename ending in ‘.sil’ even with -parse-sil specified.

Mark