mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ClangImporter] Pass through diagnostic locations for imports.
If importing a Clang module fails, we should report that at the location of the import statement. This doesn't do that fully because it isn't transitive (if Swift module Foo imports Swift module Bar, which fails to import Clang module Baz, we don't get an error in user source), but it's a step forward for the simple cases. Swift SVN r20575
This commit is contained in:
@@ -198,7 +198,8 @@ FileUnit *SerializedModuleLoader::loadAST(
|
||||
auto fileUnit = new (Ctx) SerializedASTFile(M, *loadedModuleFile);
|
||||
M.addFile(*fileUnit);
|
||||
|
||||
if (loadedModuleFile->associateWithFileContext(fileUnit)) {
|
||||
auto diagLocOrInvalid = diagLoc.getValueOr(SourceLoc());
|
||||
if (loadedModuleFile->associateWithFileContext(fileUnit, diagLocOrInvalid)) {
|
||||
LoadedModuleFiles.emplace_back(std::move(loadedModuleFile),
|
||||
Ctx.getCurrentGeneration());
|
||||
return fileUnit;
|
||||
|
||||
Reference in New Issue
Block a user