mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #28052 from owenv/educational-notes
[Diagnostics] Introduce "Educational Notes" for diagnostics
This commit is contained in:
@@ -44,6 +44,13 @@ void CompilerInvocation::setMainExecutablePath(StringRef Path) {
|
||||
llvm::sys::path::remove_filename(LibPath); // Remove /bin
|
||||
llvm::sys::path::append(LibPath, "lib", "swift");
|
||||
setRuntimeResourcePath(LibPath.str());
|
||||
|
||||
llvm::SmallString<128> DiagnosticDocsPath(Path);
|
||||
llvm::sys::path::remove_filename(DiagnosticDocsPath); // Remove /swift
|
||||
llvm::sys::path::remove_filename(DiagnosticDocsPath); // Remove /bin
|
||||
llvm::sys::path::append(DiagnosticDocsPath, "share", "doc", "swift",
|
||||
"diagnostics");
|
||||
DiagnosticOpts.DiagnosticDocumentationPath = DiagnosticDocsPath.str();
|
||||
}
|
||||
|
||||
/// If we haven't explicitly passed -prebuilt-module-cache-path, set it to
|
||||
@@ -684,7 +691,9 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
|
||||
Opts.PrintDiagnosticNames |= Args.hasArg(OPT_debug_diagnostic_names);
|
||||
Opts.EnableDescriptiveDiagnostics |=
|
||||
Args.hasArg(OPT_enable_descriptive_diagnostics);
|
||||
|
||||
if (Arg *A = Args.getLastArg(OPT_diagnostic_documentation_path)) {
|
||||
Opts.DiagnosticDocumentationPath = A->getValue();
|
||||
}
|
||||
assert(!(Opts.WarningsAsErrors && Opts.SuppressWarnings) &&
|
||||
"conflicting arguments; should have been caught by driver");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user