14#ifndef LLVM_SUPPORT_PREFIXMAPPER_H
15#define LLVM_SUPPORT_PREFIXMAPPER_H
32 :
Old(Old_.str()),
New(New_.str()) {}
42 LLVM_ABI static std::optional<MappedPrefix>
107 virtual std::optional<StringRef>
125 template <
class RangeT>
void addRange(
const RangeT &Mappings) {
142 : PathStyle(PathStyle) {}
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
PrefixMapper(sys::path::Style PathStyle=sys::path::Style::native)
std::string mapToString(StringRef Path) const
Map Path, returning std::string.
virtual std::optional< StringRef > mapImpl(StringRef Path, SmallVectorImpl< char > &Storage) const
Map (or unmap) Path.
sys::path::Style getPathStyle() const
bool map(StringRef Path, SmallVectorImpl< char > &NewPath) const
Map Path, and saving the new (or existing) path in NewPath.
ArrayRef< MappedPrefix > getMappings() const
void addInverseRange(const RangeT &Mappings)
virtual void add(const MappedPrefix &MP)
bool mapInPlace(SmallVectorImpl< char > &Path) const
Map Path in place.
void addRange(const RangeT &Mappings)
virtual ~PrefixMapper()=default
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
void sort(IteratorTy Start, IteratorTy End)
MappedPrefix(StringRef Old_, StringRef New_)
static LLVM_ABI void transformPairs(ArrayRef< std::pair< std::string, std::string > > Pairs, SmallVectorImpl< MappedPrefix > &Split)
MappedPrefix getInverse() const
static LLVM_ABI std::optional< MappedPrefix > getFromJoined(StringRef JoinedMapping)
bool operator==(const MappedPrefix &RHS) const
bool operator!=(const MappedPrefix &RHS) const
static LLVM_ABI void transformJoinedIfValid(ArrayRef< StringRef > Joined, SmallVectorImpl< MappedPrefix > &Split)
static LLVM_ABI Error transformJoined(ArrayRef< StringRef > Joined, SmallVectorImpl< MappedPrefix > &Split)