Hi all, I'm having trouble when trying to dump the AST for a set of approximately 700 Swift files. Smaller sets, of about 20 files, work fine.
Here's the deal: when working with an iOS app, Xcode prints the commands it uses to compile the Swift files in the Report navigator. If I take those commands, remove
-c and the
-emit-... options and add
-dump-ast, I can get the Swift compiller to dump the ASTs for those files.
This works just fine for two sets of about 20 files. However, if I try the same approach to a third set of 700 files, the compiler gets through 26 of them before it prints the following error:
<unknown>:0: error: unable to execute command: Illegal instruction: 4 <unknown>:0: error: compile command failed due to signal 4 (use -v to see invocation) LLVM ERROR: IO failure on output stream: Invalid argument
Searching online I've found that similar LLVM errors happen when the computer runs low on disk space (not my case), which leads me to speculate that maybe the mechanisms used to print the AST are running out of memory or something.
I've been trying to diagnose the error without much success so far, since it's hard to replicate using a custom built Swift toolchain. Any help would be appreciated.