[Printer] Conditionally print Clang types in emitted SIL.

Hopefully, this helps us debug Clang type mismatches better.
This commit is contained in:
Varun Gandhi
2020-01-15 16:15:44 -08:00
parent 5f45820755
commit a27c5f0a16
15 changed files with 86 additions and 37 deletions

View File

@@ -499,20 +499,19 @@ static bool emitSyntax(SourceFile *SF, StringRef OutputFilename) {
}
/// Writes SIL out to the given file.
static bool writeSIL(SILModule &SM, ModuleDecl *M, bool EmitVerboseSIL,
StringRef OutputFilename, bool SortSIL) {
static bool writeSIL(SILModule &SM, ModuleDecl *M, const SILOptions &Opts,
StringRef OutputFilename) {
auto OS = getFileOutputStream(OutputFilename, M->getASTContext());
if (!OS) return true;
SM.print(*OS, EmitVerboseSIL, M, SortSIL);
SM.print(*OS, M, Opts);
return M->getASTContext().hadError();
}
static bool writeSIL(SILModule &SM, const PrimarySpecificPaths &PSPs,
const CompilerInstance &Instance,
const SILOptions &opts) {
return writeSIL(SM, Instance.getMainModule(), opts.EmitVerboseSIL,
PSPs.OutputFilename, opts.EmitSortedSIL);
const SILOptions &Opts) {
return writeSIL(SM, Instance.getMainModule(), Opts, PSPs.OutputFilename);
}
/// Prints the Objective-C "generated header" interface for \p M to \p