swiftxcodeassemblyxcode6xcode7

Is there a way to view Assembly File?


In Xcode 4 I could see the assembly file by clicking on Product\Generate Output\Assembly File.

But in Xcode 6 and 7 I do not see that option for a Swift file.

Is this feature removed or where do I find it?


Solution

  • Xcode 6 and Xcode 7 (up to the current Xcode 7.3) do not offer the option to view the generated assembly file for Swift input. (Perhaps that feature will be added in a later release.)

    Currently the only way that I know of is to call the compiler on the command line with the "-emit-assembly" option, e.g.

    xcrun -sdk macosx swiftc -emit-assembly main.swift