Is there a way to view the assembly file?

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

But in Xcode 6 and 7, I do not see this option for the Swift file.

Is this feature removed or where can I find it?

+7
swift xcode6 xcode7
source share
3 answers

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

Currently, the only way I know is to call the compiler on the command line with the option "-emit-assembly", for example

  xcrun -sdk macosx swiftc -emit-assembly main.swift
+15
source share

View Partial Assembly

You can profile your application using Tools ( Cmd+I from Xcode) with the Time Profiler template. When you find the part you are interested in (for example, your critical cycle), double-click the Symbol Name icon and select View Disassembly or Show side-by-side source/disassembly views in the upper right corner to see the assembly.

From the gear icon in the same corner, you can Show ISA Reference Guide .

+1
source share

This only works for pure Swift, but a good quick assembler is here: https://swift.godbolt.org . It even encodes the colors of different sections so you can see from which lines the assembly is going.

+1
source share

All Articles