@@ -771,11 +771,13 @@ bool ClangImporter::canReadPCH(StringRef PCHFilename) {
771
771
772
772
Optional<std::string>
773
773
ClangImporter::getPCHFilename (const ClangImporterOptions &ImporterOptions,
774
- const std::string &SwiftPCHHash ) {
774
+ StringRef SwiftPCHHash, bool &isExplicit ) {
775
775
if (llvm::sys::path::extension (ImporterOptions.BridgingHeader )
776
776
.endswith (PCH_EXTENSION)) {
777
+ isExplicit = true ;
777
778
return ImporterOptions.BridgingHeader ;
778
779
}
780
+ isExplicit = false ;
779
781
780
782
const auto &BridgingHeader = ImporterOptions.BridgingHeader ;
781
783
const auto &PCHOutputDir = ImporterOptions.PrecompiledHeaderOutputDir ;
@@ -798,12 +800,14 @@ ClangImporter::getPCHFilename(const ClangImporterOptions &ImporterOptions,
798
800
799
801
Optional<std::string>
800
802
ClangImporter::getOrCreatePCH (const ClangImporterOptions &ImporterOptions,
801
- const std::string &SwiftPCHHash) {
802
- auto PCHFilename = getPCHFilename (ImporterOptions, SwiftPCHHash);
803
+ StringRef SwiftPCHHash) {
804
+ bool isExplicit;
805
+ auto PCHFilename = getPCHFilename (ImporterOptions, SwiftPCHHash,
806
+ isExplicit);
803
807
if (!PCHFilename.hasValue ()) {
804
808
return None;
805
809
}
806
- if (!canReadPCH (PCHFilename.getValue ())) {
810
+ if (!isExplicit && ! canReadPCH (PCHFilename.getValue ())) {
807
811
SmallString<256 > Message;
808
812
llvm::raw_svector_ostream OS (Message);
809
813
auto Diags = new clang::TextDiagnosticPrinter {
0 commit comments