Order file generation appears to be supported by clang via -cc1 -forder-file-instrumentation, and in turn LLVM has an option --enable-order-file-instrumentation. Is this option currently supported for swiftc via -Xllvm? If not, it would be great to have it, or better yet a flag within swiftc. I've seen order files reduce startup time by ~5% for large apps.
Note that there is support in swiftc to instrument all function calls with -sanitize-coverage but using it for order file generation is much less convenient and obvious.
I looked into this a little bit by chatting with @vedantk.
My understanding is that this is something where one only needs to set an option in LLVM. If my understanding is correct then this should just be a matter of creating a driver option like clang has to expose this to the user. Patches welcome?