Skip to content

Commit 34e0517

Browse files
Merge pull request #82519 from AnthonyLatsis/rebranch
Revert "ClangImporter: Refactor Clang invocation path remapping after…
2 parents 768768a + a7ccf93 commit 34e0517

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "swift/AST/Decl.h"
2828
#include "swift/AST/DiagnosticEngine.h"
2929
#include "swift/AST/DiagnosticsClangImporter.h"
30-
#include "swift/AST/DiagnosticsFrontend.h"
3130
#include "swift/AST/DiagnosticsSema.h"
3231
#include "swift/AST/Evaluator.h"
3332
#include "swift/AST/IRGenOptions.h"
@@ -4236,19 +4235,8 @@ ClangImporter::getSwiftExplicitModuleDirectCC1Args() const {
42364235
if (!Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper.empty()) {
42374236
// Remap all the paths if requested.
42384237
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);
42524240
clang::tooling::dependencies::DepscanPrefixMapping::remapInvocationPaths(
42534241
instance, Mapper);
42544242
instance.getFrontendOpts().PathPrefixMappings.clear();

0 commit comments

Comments
 (0)