Skip to content

Frontend: use preferred path spellings for paths #81103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/Frontend/DiagnosticVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,15 +1289,17 @@ bool DiagnosticVerifier::finishProcessing() {

SmallVector<unsigned, 4> additionalBufferIDs;
for (auto path : AdditionalFilePaths) {
auto bufferID = SM.getIDForBufferIdentifier(path);
llvm::SmallString<261> buffer{path};
llvm::sys::path::make_preferred(buffer);
auto bufferID = SM.getIDForBufferIdentifier(buffer);
if (!bufferID) {
// Still need to scan this file for expectations.
auto result = SM.getFileSystem()->getBufferForFile(path);
auto result = SM.getFileSystem()->getBufferForFile(buffer);
if (!result) {
auto message = SM.GetMessage(
SourceLoc(), llvm::SourceMgr::DiagKind::DK_Error,
llvm::Twine("unable to open file in '-verify-additional-file ") +
path + "': " + result.getError().message(), {}, {});
buffer + "': " + result.getError().message(), {}, {});
printDiagnostic(message);
Result.HadError |= true;
continue;
Expand Down
3 changes: 0 additions & 3 deletions test/ModuleInterface/BadStdlib.swiftinterface
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@
import ClangMod

public func useHasPointer(_: HasPointer)

// FIXME: https://github.com/apple/swift/issues/56844
// UNSUPPORTED: OS=windows-msvc