mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] Address misc review comments.
This commit is contained in:
@@ -130,10 +130,36 @@ generateOptimizationRemarkRegex(DiagnosticEngine &Diags, ArgList &Args,
|
||||
return Pattern;
|
||||
}
|
||||
|
||||
/// \brief Save a copy of any flags marked as ParseableInterfaceOption, if running
|
||||
// Lifted from the clang driver.
|
||||
static void PrintArg(raw_ostream &OS, const char *Arg, StringRef TempDir) {
|
||||
const bool Escape = std::strpbrk(Arg, "\"\\$ ");
|
||||
|
||||
if (!TempDir.empty() && StringRef(Arg).startswith(TempDir)) {
|
||||
// Don't write temporary file names in the debug info. This would prevent
|
||||
// incremental llvm compilation because we would generate different IR on
|
||||
// every compiler invocation.
|
||||
Arg = "<temporary-file>";
|
||||
}
|
||||
|
||||
if (!Escape) {
|
||||
OS << Arg;
|
||||
return;
|
||||
}
|
||||
|
||||
// Quote and escape. This isn't really complete, but good enough.
|
||||
OS << '"';
|
||||
while (const char c = *Arg++) {
|
||||
if (c == '"' || c == '\\' || c == '$')
|
||||
OS << '\\';
|
||||
OS << c;
|
||||
}
|
||||
OS << '"';
|
||||
}
|
||||
|
||||
/// Save a copy of any flags marked as ParseableInterfaceOption, if running
|
||||
/// in a mode that is going to emit a .swiftinterface file.
|
||||
static void SaveParseableInterfaceArgs(ParseableInterfaceOptions &Opts,
|
||||
ArgList &Args, DiagnosticEngine &Diags) {
|
||||
ArgList &Args, DiagnosticEngine &Diags) {
|
||||
if (!Args.hasArg(options::OPT_emit_interface_path))
|
||||
return;
|
||||
ArgStringList RenderedArgs;
|
||||
@@ -632,6 +658,9 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (Args.hasArg(OPT_sil_existential_specializer)) {
|
||||
Opts.ExistentialSpecializer = true;
|
||||
}
|
||||
if (const Arg *A = Args.getLastArg(OPT_num_threads)) {
|
||||
if (StringRef(A->getValue()).getAsInteger(10, Opts.NumThreads)) {
|
||||
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
|
||||
|
||||
Reference in New Issue
Block a user