mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Frontend] Optional remarks on loaded modules location
Passing the frontend flag -Rmodule-loading makes the compiler emit remarks with the path of every module loaded. The path for Swift modules is either the swiftinterface file for modules built with library evolution or the binary swiftmodule otherwise. The path for clangmodules is always in the cache which could be improved as it may be less useful. Here's an extract of the output for a simple SwiftUI app: <unknown>:0: remark: loaded module from /Users/xymus/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/2VJP7CNCGWRF0/SwiftShims-18ZF6992O9H75.pcm <unknown>:0: remark: loaded module from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftinterface <unknown>:0: remark: loaded module from /Users/xymus/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/2VJP7CNCGWRF0/os-1HVC6DNXVU37C.pcm <unknown>:0: remark: loaded module from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.2.sdk/usr/lib/swift/os.swiftmodule/x86_64-apple-ios-simulator.swiftinterface <unknown>:0: remark: loaded module from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.2.sdk/System/Library/Frameworks/SwiftUI.framework/Modules/SwiftUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface
This commit is contained in:
@@ -577,6 +577,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
|
||||
Opts.EnableCrossImportRemarks = Args.hasArg(OPT_emit_cross_import_remarks);
|
||||
|
||||
Opts.EnableModuleLoadingRemarks = Args.hasArg(OPT_remark_loading_module);
|
||||
|
||||
llvm::Triple Target = Opts.Target;
|
||||
StringRef TargetArg;
|
||||
std::string TargetArgScratch;
|
||||
|
||||
Reference in New Issue
Block a user