Make the DWARF version emitted by the Swift compiler configurable.

Previously it was hardcoded to version 4 on all platforms.
This patch introduces a driver and frontend option -dwarf-version to configure it if needed.
This commit is contained in:
Adrian Prantl
2023-10-18 13:15:35 -07:00
parent d19fe381fa
commit a26bbb0baf
9 changed files with 76 additions and 6 deletions

View File

@@ -2240,6 +2240,10 @@ int swift::performFrontend(ArrayRef<const char *> Args,
trace.emplace(*buffer);
});
// Setting DWARF Version based on frontend options.
IRGenOptions &IRGenOpts = Invocation.getIRGenOptions();
IRGenOpts.DWARFVersion = IRGenOpts.DWARFVersion;
// The compiler invocation is now fully configured; notify our observer.
if (observer) {
observer->parsedArgs(Invocation);