Merge remote-tracking branch 'origin/main' into rebranch

This commit is contained in:
swift-ci
2022-05-16 14:13:30 -07:00
14 changed files with 255 additions and 37 deletions

View File

@@ -25,6 +25,7 @@
#define SWIFT_BASIC_PATHREMAPPER_H
#include "swift/Basic/LLVM.h"
#include "clang/Basic/PathRemapper.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
@@ -57,6 +58,15 @@ public:
Path.substr(Mapping.first.size())).str();
return Path.str();
}
/// Returns the Clang PathRemapper equivalent, suitable for use with Clang
/// APIs.
clang::PathRemapper asClangPathRemapper() const {
clang::PathRemapper Remapper;
for (const auto &Mapping : PathMappings)
Remapper.addMapping(Mapping.first, Mapping.second);
return Remapper;
}
};
class PathObfuscator {