@@ -1366,7 +1366,7 @@ bool ClangImporter::Implementation::importHeader(
1366
1366
// to correct. The fix would be explicitly importing on the command line.
1367
1367
if (implicitImport && !allParsedDecls.empty () &&
1368
1368
BridgingHeaderExplicitlyRequested) {
1369
- SwiftContext. Diags . diagnose (
1369
+ diagnose (
1370
1370
diagLoc, diag::implicit_bridging_header_imported_from_module,
1371
1371
llvm::sys::path::filename (headerName), adapter->getName ());
1372
1372
}
@@ -1401,8 +1401,7 @@ bool ClangImporter::Implementation::importHeader(
1401
1401
1402
1402
// FIXME: What do we do if there was already an error?
1403
1403
if (!hadError && clangDiags.hasErrorOccurred ()) {
1404
- SwiftContext.Diags .diagnose (diagLoc, diag::bridging_header_error,
1405
- headerName);
1404
+ diagnose (diagLoc, diag::bridging_header_error, headerName);
1406
1405
return true ;
1407
1406
}
1408
1407
@@ -1450,8 +1449,7 @@ bool ClangImporter::importBridgingHeader(StringRef header, ModuleDecl *adapter,
1450
1449
clang::FileManager &fileManager = Impl.Instance ->getFileManager ();
1451
1450
auto headerFile = fileManager.getFile (header, /* OpenFile=*/ true );
1452
1451
if (!headerFile) {
1453
- Impl.SwiftContext .Diags .diagnose (diagLoc, diag::bridging_header_missing,
1454
- header);
1452
+ Impl.diagnose (diagLoc, diag::bridging_header_missing, header);
1455
1453
return true ;
1456
1454
}
1457
1455
@@ -1519,8 +1517,7 @@ std::string ClangImporter::getBridgingHeaderContents(StringRef headerPath,
1519
1517
1520
1518
success |= !rewriteInstance.getDiagnostics ().hasErrorOccurred ();
1521
1519
if (!success) {
1522
- Impl.SwiftContext .Diags .diagnose ({},
1523
- diag::could_not_rewrite_bridging_header);
1520
+ Impl.diagnose ({}, diag::could_not_rewrite_bridging_header);
1524
1521
return " " ;
1525
1522
}
1526
1523
@@ -1607,9 +1604,8 @@ ClangImporter::emitBridgingPCH(StringRef headerPath,
1607
1604
emitInstance->ExecuteAction (*action);
1608
1605
1609
1606
if (emitInstance->getDiagnostics ().hasErrorOccurred ()) {
1610
- Impl.SwiftContext .Diags .diagnose ({},
1611
- diag::bridging_header_pch_error,
1612
- outputPCHPath, headerPath);
1607
+ Impl.diagnose ({}, diag::bridging_header_pch_error,
1608
+ outputPCHPath, headerPath);
1613
1609
return true ;
1614
1610
}
1615
1611
return false ;
@@ -1668,9 +1664,7 @@ bool ClangImporter::emitPrecompiledModule(StringRef moduleMapPath,
1668
1664
emitInstance->ExecuteAction (*action);
1669
1665
1670
1666
if (emitInstance->getDiagnostics ().hasErrorOccurred ()) {
1671
- Impl.SwiftContext .Diags .diagnose ({},
1672
- diag::emit_pcm_error,
1673
- outputPath, moduleMapPath);
1667
+ Impl.diagnose ({}, diag::emit_pcm_error, outputPath, moduleMapPath);
1674
1668
return true ;
1675
1669
}
1676
1670
return false ;
@@ -1693,7 +1687,7 @@ bool ClangImporter::dumpPrecompiledModule(StringRef modulePath,
1693
1687
dumpInstance->ExecuteAction (*action);
1694
1688
1695
1689
if (dumpInstance->getDiagnostics ().hasErrorOccurred ()) {
1696
- Impl.SwiftContext . Diags . diagnose ({}, diag::dump_pcm_error, modulePath);
1690
+ Impl.diagnose ({}, diag::dump_pcm_error, modulePath);
1697
1691
return true ;
1698
1692
}
1699
1693
return false ;
0 commit comments