|
27 | 27 | #include "swift/AST/Decl.h"
|
28 | 28 | #include "swift/AST/DiagnosticEngine.h"
|
29 | 29 | #include "swift/AST/DiagnosticsClangImporter.h"
|
30 |
| -#include "swift/AST/DiagnosticsFrontend.h" |
31 | 30 | #include "swift/AST/DiagnosticsSema.h"
|
32 | 31 | #include "swift/AST/Evaluator.h"
|
33 | 32 | #include "swift/AST/IRGenOptions.h"
|
@@ -4236,19 +4235,8 @@ ClangImporter::getSwiftExplicitModuleDirectCC1Args() const {
|
4236 | 4235 | if (!Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper.empty()) {
|
4237 | 4236 | // Remap all the paths if requested.
|
4238 | 4237 | llvm::PrefixMapper Mapper;
|
4239 |
| - SmallVector<llvm::MappedPrefix> Prefixes; |
4240 |
| - if (auto E = llvm::MappedPrefix::transformJoined( |
4241 |
| - Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper, Prefixes)) { |
4242 |
| - // Take permanent ownership of this string. In general the diagnostic |
4243 |
| - // might outlive this function. |
4244 |
| - auto errorMessage = |
4245 |
| - Impl.SwiftContext.AllocateCopy(llvm::toString(std::move(E))); |
4246 |
| - Impl.SwiftContext.Diags.diagnose(SourceLoc(), diag::error_prefix_mapping, |
4247 |
| - errorMessage); |
4248 |
| - } |
4249 |
| - Mapper.addRange(Prefixes); |
4250 |
| - Mapper.sort(); |
4251 |
| - |
| 4238 | + clang::tooling::dependencies::DepscanPrefixMapping::configurePrefixMapper( |
| 4239 | + Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper, Mapper); |
4252 | 4240 | clang::tooling::dependencies::DepscanPrefixMapping::remapInvocationPaths(
|
4253 | 4241 | instance, Mapper);
|
4254 | 4242 | instance.getFrontendOpts().PathPrefixMappings.clear();
|
|
0 commit comments