@@ -57,10 +57,6 @@ using namespace swift;
5757using namespace swift ::serialization;
5858using llvm::Expected;
5959
60- StringRef swift::getNameOfModule (const ModuleFile *MF) {
61- return MF->getName ();
62- }
63-
6460namespace {
6561 struct DeclAndOffset {
6662 const Decl *D;
@@ -111,7 +107,7 @@ namespace {
111107 os << DeclAndOffset{DeclOrOffset.get (), offset};
112108 }
113109 }
114- os << " in '" << getNameOfModule (MF ) << " '\n " ;
110+ os << " in '" << MF-> getName ( ) << " '\n " ;
115111 }
116112 };
117113
@@ -166,33 +162,15 @@ static void skipRecord(llvm::BitstreamCursor &cursor, unsigned recordKind) {
166162 (void )kind;
167163}
168164
169- void ModuleFile::fatal (llvm::Error error) {
170- if (FileContext) {
171- getContext ().Diags .diagnose (SourceLoc (), diag::serialization_fatal, Core->Name );
172- getContext ().Diags .diagnose (
173- SourceLoc (), diag::serialization_misc_version, Core->Name ,
174- Core->MiscVersion , allowCompilerErrors ());
175-
176- if (!Core->CompatibilityVersion .empty ()) {
177- if (getContext ().LangOpts .EffectiveLanguageVersion
178- != Core->CompatibilityVersion ) {
179- SmallString<16 > effectiveVersionBuffer, compatVersionBuffer;
180- {
181- llvm::raw_svector_ostream out (effectiveVersionBuffer);
182- out << getContext ().LangOpts .EffectiveLanguageVersion ;
183- }
184- {
185- llvm::raw_svector_ostream out (compatVersionBuffer);
186- out << Core->CompatibilityVersion ;
187- }
188- getContext ().Diags .diagnose (
189- SourceLoc (), diag::serialization_compatibility_version_mismatch,
190- effectiveVersionBuffer, Core->Name , compatVersionBuffer);
191- }
192- }
193- }
165+ void ModuleFile::fatal (llvm::Error error) const {
166+ if (FileContext)
167+ getContext ().Diags .diagnose (SourceLoc (), diag::serialization_fatal,
168+ Core->Name );
169+ Core->fatal (std::move (error));
170+ }
194171
195- ModuleFileSharedCore::fatal (std::move (error));
172+ void ModuleFile::outputDiagnosticInfo (llvm::raw_ostream &os) const {
173+ Core->outputDiagnosticInfo (os);
196174}
197175
198176static Optional<swift::AccessorKind>
@@ -6294,7 +6272,7 @@ void ModuleFile::finishNormalConformance(NormalProtocolConformance *conformance,
62946272 uint64_t contextData) {
62956273 using namespace decls_block ;
62966274
6297- PrettyStackTraceModuleFile traceModule (" While reading from " , *this );
6275+ PrettyStackTraceModuleFile traceModule (*this );
62986276 PrettyStackTraceConformance trace (" finishing conformance for" ,
62996277 conformance);
63006278 ++NumNormalProtocolConformancesCompleted;
@@ -6710,9 +6688,3 @@ Optional<ForeignAsyncConvention> ModuleFile::maybeReadForeignAsyncConvention() {
67106688 completionHandlerErrorFlagParamIndex,
67116689 errorFlagPolarity);
67126690}
6713-
6714- void serialization::PrettyStackTraceModuleFile::outputModuleBuildInfo (
6715- raw_ostream &os) const {
6716- if (MF.compiledAllowingCompilerErrors ())
6717- os << " (built while allowing compiler errors)" ;
6718- }
0 commit comments