LLVM  6.0.0svn
Classes | Enumerations | Functions
llvm::sys::path Namespace Reference

Classes

class  const_iterator
 Path iterator. More...
 
class  reverse_iterator
 Reverse path iterator. More...
 

Enumerations

enum  Style { Style::windows, Style::posix, Style::native }
 

Functions

static SmallString< 256 > remove_dots (StringRef path, bool remove_dot_dot, Style style)
 
std::error_code widenPath (const Twine &Path8, SmallVectorImpl< wchar_t > &Path16)
 
Lexical Component Iterator
const_iterator begin (StringRef path, Style style=Style::native)
 Get begin iterator over path. More...
 
const_iterator end (StringRef path)
 Get end iterator over path. More...
 
reverse_iterator rbegin (StringRef path, Style style=Style::native)
 Get reverse begin iterator over path. More...
 
reverse_iterator rend (StringRef path)
 Get reverse end iterator over path. More...
 
Lexical Modifiers
void remove_filename (SmallVectorImpl< char > &path, Style style=Style::native)
 Remove the last component from path unless it is the root dir. More...
 
void replace_extension (SmallVectorImpl< char > &path, const Twine &extension, Style style=Style::native)
 Replace the file extension of path with extension. More...
 
void replace_path_prefix (SmallVectorImpl< char > &Path, const StringRef &OldPrefix, const StringRef &NewPrefix, Style style=Style::native)
 Replace matching path prefix with another path. More...
 
void append (SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
 Append to path. More...
 
void append (SmallVectorImpl< char > &path, Style style, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
 
void append (SmallVectorImpl< char > &path, const_iterator begin, const_iterator end, Style style=Style::native)
 Append to path. More...
 
Transforms (or some other better name)
void native (const Twine &path, SmallVectorImpl< char > &result, Style style=Style::native)
 Convert path to the native form. More...
 
void native (SmallVectorImpl< char > &path, Style style=Style::native)
 Convert path to the native form in place. More...
 
std::string convert_to_slash (StringRef path, Style style=Style::native)
 Replaces backslashes with slashes if Windows. More...
 
Lexical Observers
StringRef root_name (StringRef path, Style style=Style::native)
 Get root name. More...
 
StringRef root_directory (StringRef path, Style style=Style::native)
 Get root directory. More...
 
StringRef root_path (StringRef path, Style style=Style::native)
 Get root path. More...
 
StringRef relative_path (StringRef path, Style style=Style::native)
 Get relative path. More...
 
StringRef parent_path (StringRef path, Style style=Style::native)
 Get parent path. More...
 
StringRef filename (StringRef path, Style style=Style::native)
 Get filename. More...
 
StringRef stem (StringRef path, Style style=Style::native)
 Get stem. More...
 
StringRef extension (StringRef path, Style style=Style::native)
 Get extension. More...
 
bool is_separator (char value, Style style=Style::native)
 Check whether the given char is a path separator on the host OS. More...
 
StringRef get_separator (Style style=Style::native)
 Return the preferred separator for this platform. More...
 
void system_temp_directory (bool erasedOnReboot, SmallVectorImpl< char > &result)
 Get the typical temporary directory for the system, e.g., "/var/tmp" or "C:/TEMP". More...
 
bool home_directory (SmallVectorImpl< char > &result)
 Get the user's home directory. More...
 
bool user_cache_directory (SmallVectorImpl< char > &Result, const Twine &Path1, const Twine &Path2="", const Twine &Path3="")
 Get the user's cache directory. More...
 
bool has_root_name (const Twine &path, Style style=Style::native)
 Has root name? More...
 
bool has_root_directory (const Twine &path, Style style=Style::native)
 Has root directory? More...
 
bool has_root_path (const Twine &path, Style style=Style::native)
 Has root path? More...
 
bool has_relative_path (const Twine &path, Style style=Style::native)
 Has relative path? More...
 
bool has_parent_path (const Twine &path, Style style=Style::native)
 Has parent path? More...
 
bool has_filename (const Twine &path, Style style=Style::native)
 Has filename? More...
 
bool has_stem (const Twine &path, Style style=Style::native)
 Has stem? More...
 
bool has_extension (const Twine &path, Style style=Style::native)
 Has extension? More...
 
bool is_absolute (const Twine &path, Style style=Style::native)
 Is path absolute? More...
 
bool is_relative (const Twine &path, Style style=Style::native)
 Is path relative? More...
 
StringRef remove_leading_dotslash (StringRef path, Style style=Style::native)
 Remove redundant leading "./" pieces and consecutive separators. More...
 
bool remove_dots (SmallVectorImpl< char > &path, bool remove_dot_dot=false, Style style=Style::native)
 In-place remove any '. More...
 

Enumeration Type Documentation

◆ Style

Enumerator
windows 
posix 
native 

Definition at line 28 of file Path.h.

Function Documentation

◆ append() [1/3]

void llvm::sys::path::append ( SmallVectorImpl< char > &  path,
const Twine a,
const Twine b = "",
const Twine c = "",
const Twine d = "" 
)

Append to path.

/foo + bar/f => /foo/bar/f
/foo/ + bar/f => /foo/bar/f
foo + bar/f => foo/bar/f
Parameters
pathSet to path + component.
aThe component to be appended to path.

Definition at line 464 of file Path.cpp.

References llvm::support::native.

Referenced by llvm::opt::DerivedArgList::AddFlagArg(), llvm::opt::DerivedArgList::AddJoinedArg(), llvm::opt::DerivedArgList::AddPositionalArg(), llvm::opt::DerivedArgList::AddSeparateArg(), append(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::append(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::assign(), computeRelativePath(), createUniqueEntity(), llvm::NVPTXAsmPrinter::emitLineNumberAsDotLoc(), llvm::HexagonShuffler::end(), ExpandResponseFile(), llvm::sys::Process::FindInEnvPath(), findInputFile(), llvm::symbolize::LLVMSymbolizer::flush(), llvm::LineEditor::getDefaultHistoryPath(), llvm::DWARFUnit::getDWOId(), llvm::DWARFDebugLine::LineTable::getFileNameByIndex(), llvm::object::Archive::Child::getFullName(), getFunctionName(), getNonDebugInstr(), greaterWithBias(), llvm::detail::IEEEFloat::IEEEFloat(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::insert(), llvm::LiveRange::isUndefIn(), llvm::lto::localCache(), llvm::sys::fs::make_absolute(), llvm::sys::path::reverse_iterator::operator*(), PrintQuotedString(), llvm::pruneCache(), remove_dots(), llvm::sys::fs::directory_entry::replace_filename(), replace_path_prefix(), llvm::rdf::NodeBase::setFlags(), llvm::SmallVector< llvm::cl::parser::OptionInfo, 8 >::SmallVector(), llvm::opt::ArgList::toOptSpecifier(), llvm::detail::IEEEFloat::toString(), useFuncSeen(), user_cache_directory(), and writeGeneratedObject().

◆ append() [2/3]

void llvm::sys::path::append ( SmallVectorImpl< char > &  path,
Style  style,
const Twine a,
const Twine b = "",
const Twine c = "",
const Twine d = "" 
)

◆ append() [3/3]

void llvm::sys::path::append ( SmallVectorImpl< char > &  path,
const_iterator  begin,
const_iterator  end,
Style  style = Style::native 
)

Append to path.

/foo + [bar,f] => /foo/bar/f
/foo/ + [bar,f] => /foo/bar/f
foo + [bar,f] => foo/bar/f
Parameters
pathSet to path + [begin, end).
beginStart of components to append.
endOne past the end of components to append.

Definition at line 469 of file Path.cpp.

References append(), begin(), and end().

◆ begin()

const_iterator llvm::sys::path::begin ( StringRef  path,
Style  style = Style::native 
)

Get begin iterator over path.

Parameters
pathInput path.
Returns
Iterator initialized with the first component of path.

Definition at line 234 of file Path.cpp.

Referenced by addReadAttrs(), llvm::all_of(), allocateVGPR32Input(), llvm::any_of(), append(), llvm::MemoryDepChecker::areDepsSafe(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::assign(), llvm::IntrusiveBackList< llvm::DIE >::begin(), llvm::detail::enumerator< R >::begin(), llvm::ScheduleDAGMI::bottom(), llvm::DICompositeType::buildODRType(), llvm::Thumb1FrameLowering::canUseAsEpilogue(), llvm::SmallVectorTemplateCommon< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::capacity(), llvm::CC_X86_64_VectorCallGetGPRs(), llvm::CC_X86_VectorCallGetSSEs(), llvm::LoopBodyTraits::child_begin(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::clear(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::clear(), CollectSubexprs(), computeRelativePath(), llvm::concat_iterator< ValueT, IterTs >::concat_iterator(), llvm::ImmutableList< T >::contains(), llvm::detail::IEEEFloat::convertFromZeroExtendedInteger(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::copy(), llvm::copy_if(), llvm::count(), llvm::count_if(), llvm::LiveRange::covers(), llvm::SmallVectorTemplateCommon< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::data(), llvm::ScheduleDAGInstrs::doMBBSchedRegionsTopDown(), llvm::MCAssembler::dump(), llvm::ScheduleDAGMI::dumpSchedule(), llvm::MachineInstrSpan::empty(), llvm::AttributeSetNode::end(), llvm::AttributeListImpl::end(), llvm::ListInit::end(), llvm::Registry< T >::entries(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::equals(), llvm::SparseSet< unsigned, llvm::VirtReg2IndexFunctor >::erase(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::erase(), llvm::CodeExtractor::extractCodeRegion(), llvm::DwarfAccelTable::FinalizeTable(), llvm::LiveRange::find(), llvm::find(), llvm::find_if(), llvm::find_if_not(), llvm::DWARFDebugAranges::findAddress(), llvm::SparseSet< unsigned, llvm::VirtReg2IndexFunctor >::findIndex(), llvm::pdb::NativeSession::findSymbolByTypeIndex(), foldConstantInsEltIntoShuffle(), llvm::SmallVectorTemplateCommon< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::front(), llvm::FixedStreamArray< PSHashRecord >::front(), get64BitArgumentGPRs(), get64BitArgumentXMMs(), getAllSGPR128(), getAllSGPRs(), llvm::AttributeSetNode::getAsString(), llvm::MCObjectStreamer::getCurrentFragment(), llvm::SubtargetFeatures::getFeatureBits(), getFirstReloc(), llvm::ExecutionEngine::getGlobalValueAtAddress(), llvm::getIntrinsicWithChain(), llvm::getIntrinsicWithoutChain(), llvm::AVRMCExpr::getKindByName(), llvm::GlobalsAAResult::getModRefBehavior(), llvm::AVRMCExpr::getName(), getNextRegister(), getPrefixes(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::getPrevNode(), llvm::R600RegisterInfo::getReservedRegs(), llvm::MipsRegisterInfo::getReservedRegs(), llvm::PPCRegisterInfo::getReservedRegs(), llvm::ScheduleDAGMILive::getScheduledTrees(), llvm::object::MachOObjectFile::getSymbolName(), llvm::DWARFUnitSection< llvm::DWARFCompileUnit >::getUnitForIndexEntry(), llvm::DWARFUnitSection< llvm::DWARFCompileUnit >::getUnitForOffset(), greaterWithBias(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::grow(), hasOutsideLoopUser(), ImmInRange(), llvm::TargetLoweringBase::initActions(), INITIALIZE_PASS(), llvm::PriorityWorklist< llvm::LazyCallGraph::SCC *, SmallVector< llvm::LazyCallGraph::SCC *, N >, SmallDenseMap< llvm::LazyCallGraph::SCC *, ptrdiff_t > >::insert(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::insert(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::insertAfter(), llvm::is_contained(), isAlwaysFoldable(), isDebug(), isF128SoftLibCall(), isImageOrSamplerVal(), isIntrinsicInline(), llvm::HexagonMCInstrInfo::isOrderedDuplexPair(), IsPointerOffset(), llvm::LiveRange::join(), llvm::StringMap< uint64_t >::keys(), LLVMGetFirstTarget(), llvm::coverage::CoverageMapping::load(), LookupNEONLdSt(), llvm::TargetRegistry::lookupTarget(), llvm::lower_bound(), lowerV8I16GeneralSingleInputVectorShuffle(), llvm::MachineTraceMetrics::MachineTraceMetrics(), llvm::make_filter_range(), llvm::make_pointee_range(), llvm::make_pointer_range(), llvm::makeArrayRef(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::max_size(), llvm::LiveRange::MergeValueNumberInto(), node_eq(), llvm::GraphTraits< MachineRegionInfo * >::nodes_begin(), llvm::GraphTraits< RegionInfo * >::nodes_begin(), llvm::none_of(), llvm::sys::path::reverse_iterator::operator*(), llvm::PooledStringPtr::operator*(), llvm::pointee_iterator< WrappedIteratorT, T >::operator*(), llvm::pointer_iterator< WrappedIteratorT, T >::operator*(), AllocaSlices::partition_iterator::operator*(), llvm::Registry< T >::iterator::operator->(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::operator<(), llvm::TargetLibraryInfoImpl::operator=(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::operator=(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::operator==(), llvm::SmallVectorTemplateCommon< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::operator[](), llvm::LiveRange::overlaps(), llvm::LiveRange::overlapsFrom(), llvm::OwningArrayRef< T >::OwningArrayRef(), llvm::MCSectionMachO::ParseSectionSpecifier(), llvm::partition(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::pop_front(), llvm::MIBundleBuilder::prepend(), llvm::DominanceFrontierBase< BasicBlock, false >::print(), llvm::DwarfAccelTable::print(), llvm::LoopBase< BasicBlock, Loop >::print(), llvm::opt::OptTable::PrintHelp(), llvm::AttributeSetNode::Profile(), ProfitableToMerge(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::push_front(), llvm::readExponent(), remove_dots(), llvm::remove_if(), llvm::DominanceFrontierBase< BasicBlock, false >::removeBlock(), llvm::PMDataManager::removeNotPreservedAnalysis(), llvm::LiveRange::removeSegment(), llvm::RegionBase< RegionTraits< Function > >::removeSubRegion(), llvm::SmallVectorTemplateCommon< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::rend(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::rend(), llvm::MutableArrayRef< BitWord >::rend(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::resize(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::reverse(), root_directory(), root_name(), root_path(), llvm::ReservoirSampler< T, GenT >::sample(), llvm::VLIWMachineScheduler::schedule(), llvm::ScheduleDAGMI::schedule(), llvm::ScheduleDAGMILive::schedule(), llvm::object::COFFObjectFile::section_rel_begin(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::set_size(), llvm::SmallVectorTemplateCommon< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::size(), llvm::skipLeadingZeroesAndAnyDot(), AllocaSlices::SliceBuilder::SliceBuilder(), llvm::Thumb1FrameLowering::spillCalleeSavedRegisters(), llvm::HexagonBlockRanges::RangeList::subtract(), SumCanReachMin(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::swap(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::take_until(), llvm::MutableArrayRef< BitWord >::take_until(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::take_while(), llvm::MutableArrayRef< BitWord >::take_while(), llvm::TargetLibraryInfoImpl::TargetLibraryInfoImpl(), llvm::TargetLoweringBase::TargetLoweringBase(), llvm::to_vector(), llvm::transform(), llvm::HexagonBlockRanges::RangeList::unionize(), llvm::TargetLoweringBase::ValueTypeActionImpl::ValueTypeActionImpl(), llvm::LiveRange::verify(), llvm::LoopInfoBase< BasicBlock, Loop >::verify(), llvm::verifyIntrinsicTables(), llvm::LoopBase< BasicBlock, Loop >::verifyLoop(), llvm::LoopBase< BasicBlock, Loop >::verifyLoopNest(), writeIdentificationBlock(), llvm::AntiDepBreaker::~AntiDepBreaker(), and llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::~SmallVectorImpl().

◆ convert_to_slash()

std::string llvm::sys::path::convert_to_slash ( StringRef  path,
Style  style = Style::native 
)

Replaces backslashes with slashes if Windows.

Parameters
pathprocessed path
Returns
The result of replacing backslashes with forward slashes if Windows. On Unix, this function is a no-op because backslashes are valid path chracters.

Definition at line 565 of file Path.cpp.

References llvm::object::replace(), and llvm::StringRef::str().

Referenced by llvm::TarWriter::append(), and llvm::sys::path::reverse_iterator::operator*().

◆ end()

const_iterator llvm::sys::path::end ( StringRef  path)

Get end iterator over path.

Parameters
pathInput path.
Returns
Iterator initialized to the end of path.

Definition at line 243 of file Path.cpp.

References llvm::StringRef::size().

Referenced by llvm::LiveRangeUpdater::add(), addData(), addReadAttrs(), llvm::LiveRange::addSegment(), llvm::DominanceFrontierBase< BasicBlock, false >::addToFrontier(), llvm::LiveRange::advanceTo(), llvm::all_of(), llvm::any_of(), append(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::append(), llvm::MIBundleBuilder::append(), llvm::MemoryDepChecker::areDepsSafe(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::assign(), llvm::SmallVectorTemplateCommon< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::back(), llvm::MachineBasicBlock::back(), llvm::FixedStreamArray< PSHashRecord >::back(), llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::begin(), llvm::ScopedHashTable< K, V, KInfo, AllocatorTy >::begin(), llvm::IntrusiveBackList< llvm::DIE >::begin(), llvm::ScheduleDAGMI::bottom(), llvm::DICompositeType::buildODRType(), canBeFeederToNewValueJump(), canCompareBeNewValueJump(), llvm::CC_X86_64_VectorCallGetGPRs(), llvm::CC_X86_VectorCallGetSSEs(), llvm::LiveIntervals::checkRegMaskInterference(), checkThreadCommand(), llvm::LoopBodyTraits::child_end(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::clear(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::clear(), CollectSubexprs(), llvm::DominanceFrontierBase< BasicBlock, false >::compare(), computeRelativePath(), llvm::concat_iterator< ValueT, IterTs >::concat_iterator(), llvm::ImmutableList< T >::contains(), llvm::LiveRange::Segment::contains(), llvm::LiveRange::Segment::containsInterval(), llvm::detail::IEEEFloat::convertFromZeroExtendedInteger(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::copy(), llvm::copy_if(), llvm::SparseSet< unsigned, llvm::VirtReg2IndexFunctor >::count(), llvm::StringMap< uint64_t >::count(), llvm::SmallPtrSetImpl< const llvm::SCEV * >::count(), llvm::count(), llvm::count_if(), llvm::LiveRange::covers(), llvm::object::MachOObjectFile::create(), llvm::createCopyConstrainDAGMutation(), llvm::decodeSLEB128(), llvm::decodeULEB128(), llvm::ScheduleDAGInstrs::doMBBSchedRegionsTopDown(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::drop_until(), llvm::MutableArrayRef< BitWord >::drop_until(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::drop_while(), llvm::MutableArrayRef< BitWord >::drop_while(), llvm::MCAssembler::dump(), llvm::ScheduleDAGMI::dumpSchedule(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::emplace_back(), llvm::MachineInstrSpan::empty(), llvm::detail::enumerator< R >::end(), llvm::Registry< T >::entries(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::equals(), llvm::SparseSet< unsigned, llvm::VirtReg2IndexFunctor >::erase(), llvm::StringMap< uint64_t >::erase(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::erase(), llvm::UnwindOpcodeAssembler::Finalize(), llvm::DwarfAccelTable::FinalizeTable(), llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::LiveRange::find(), llvm::StringMap< uint64_t >::find(), llvm::find(), llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find_as(), llvm::find_if(), llvm::find_if_not(), llvm::DWARFDebugAranges::findAddress(), llvm::SparseSet< unsigned, llvm::VirtReg2IndexFunctor >::findIndex(), llvm::LiveRange::FindSegmentContaining(), llvm::pdb::NativeSession::findSymbolByTypeIndex(), format_to_buffer(), generateEquivalentSub(), get64BitArgumentGPRs(), get64BitArgumentXMMs(), getAllocationDataForFunction(), llvm::AttributeSetNode::getAsString(), llvm::SubtargetFeatures::getFeatureBits(), llvm::ExecutionEngine::getGlobalValueAtAddress(), llvm::getIntrinsicWithChain(), llvm::getIntrinsicWithoutChain(), llvm::AVRMCExpr::getKindByName(), llvm::GlobalsAAResult::getModRefBehavior(), llvm::AVRMCExpr::getName(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::getNextNode(), getNextRegister(), getPrefixes(), llvm::object::ArchiveMemberHeader::getRawName(), llvm::R600RegisterInfo::getReservedRegs(), llvm::MipsRegisterInfo::getReservedRegs(), llvm::ScheduleDAGMILive::getScheduledTrees(), llvm::LiveRange::getSegmentContaining(), llvm::object::MachOObjectFile::getSymbolName(), llvm::DenseMapInfo< CallValue >::getTombstoneKey(), llvm::DWARFUnitSection< llvm::DWARFCompileUnit >::getUnitForIndexEntry(), llvm::DWARFUnitSection< llvm::DWARFCompileUnit >::getUnitForOffset(), getUs(), llvm::LiveRange::getVNInfoAt(), llvm::LiveRange::getVNInfoBefore(), greaterWithBias(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::grow(), llvm::hashing::detail::hash_combine_range_impl(), hasOutsideLoopUser(), ImmInRange(), llvm::MachineInstr::implicit_operands(), llvm::TargetLoweringBase::initActions(), INITIALIZE_PASS(), llvm::PriorityWorklist< llvm::LazyCallGraph::SCC *, SmallVector< llvm::LazyCallGraph::SCC *, N >, SmallDenseMap< llvm::LazyCallGraph::SCC *, ptrdiff_t > >::insert(), llvm::SparseSet< unsigned, llvm::VirtReg2IndexFunctor >::insert(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::insert(), llvm::MachineBasicBlock::insert(), llvm::MachineBasicBlock::insertAfter(), llvm::interpretDecimal(), llvm::is_contained(), isAlwaysFoldable(), isDebug(), isF128SoftLibCall(), isImageOrSamplerVal(), isIntrinsicInline(), llvm::LiveRange::isLiveAtIndexes(), llvm::HexagonMCInstrInfo::isOrderedDuplexPair(), llvm::SplitAnalysis::isOriginalEndpoint(), IsPointerOffset(), isUnconditionalBranch(), llvm::LiveRange::join(), llvm::StringMap< uint64_t >::keys(), llvm::LiveRange::liveAt(), LLVMGetFirstTarget(), llvm::coverage::CoverageMapping::load(), llvm::StringMap< uint64_t >::lookup(), LookupNEONLdSt(), llvm::TargetRegistry::lookupTarget(), llvm::lower_bound(), llvm::MachineTraceMetrics::MachineTraceMetrics(), llvm::make_filter_range(), llvm::make_pointee_range(), llvm::make_pointer_range(), llvm::makeArrayRef(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::max_size(), mergeOperations(), llvm::LiveRange::MergeValueNumberInto(), node_eq(), llvm::GraphTraits< MachineRegionInfo * >::nodes_end(), llvm::GraphTraits< RegionInfo * >::nodes_end(), llvm::none_of(), llvm::sys::path::reverse_iterator::operator*(), AllocaSlices::partition_iterator::operator*(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::operator<(), llvm::TargetLibraryInfoImpl::operator=(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::operator=(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::operator==(), llvm::LiveRange::overlaps(), llvm::LiveRange::overlapsFrom(), llvm::MCSectionMachO::ParseSectionSpecifier(), llvm::partition(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back(), llvm::SmallVectorTemplateBase< T, true >::pop_back(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::pop_back(), llvm::DominanceFrontierBase< BasicBlock, false >::print(), llvm::LoopBase< BasicBlock, Loop >::print(), llvm::AttributeSetNode::Profile(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateBase< T, true >::push_back(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::push_back(), llvm::LiveRange::Query(), llvm::SmallVectorTemplateCommon< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::rbegin(), llvm::ArrayRef< llvm::irsymtab::storage::Comdat >::rbegin(), llvm::MutableArrayRef< BitWord >::rbegin(), llvm::readExponent(), remove_dots(), llvm::remove_if(), llvm::DominanceFrontierBase< BasicBlock, false >::removeBlock(), llvm::DominanceFrontierBase< BasicBlock, false >::removeFromFrontier(), llvm::PMDataManager::removeNotPreservedAnalysis(), llvm::LiveRange::removeSegment(), llvm::LiveRange::removeValNo(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::resize(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::reverse(), root_directory(), root_name(), root_path(), llvm::SmallVectorTemplateCommon< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::size(), llvm::skipLeadingZeroesAndAnyDot(), AllocaSlices::SliceBuilder::SliceBuilder(), llvm::Thumb1FrameLowering::spillCalleeSavedRegisters(), llvm::Regex::sub(), SumCanReachMin(), llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::swap(), llvm::TargetLibraryInfoImpl::TargetLibraryInfoImpl(), llvm::TargetLoweringBase::TargetLoweringBase(), llvm::MachineBasicBlock::terminators(), llvm::to_vector(), llvm::APInt::toString(), llvm::totalExponent(), llvm::transform(), llvm::LiveIntervals::HMEditor::updateAllRanges(), llvm::utohexstr(), llvm::utostr(), llvm::TargetLoweringBase::ValueTypeActionImpl::ValueTypeActionImpl(), llvm::LiveRange::verify(), llvm::LoopInfoBase< BasicBlock, Loop >::verify(), llvm::verifyIntrinsicTables(), llvm::LoopBase< BasicBlock, Loop >::verifyLoop(), llvm::LoopBase< BasicBlock, Loop >::verifyLoopNest(), write_unsigned_impl(), writeIdentificationBlock(), llvm::AntiDepBreaker::~AntiDepBreaker(), and llvm::SmallVectorImpl< std::pair< llvm::RelocationValueRef, llvm::RelocationEntry > >::~SmallVectorImpl().

◆ extension()

StringRef llvm::sys::path::extension ( StringRef  path,
Style  style = Style::native 
)

Get extension.

If filename contains a dot but not solely one or two dots, result is the substring of filename starting at (and including) the last dot, and ending at the end of path. Otherwise "".

/foo/bar.txt => .txt
/foo/bar => <empty>
/foo/.txt => .txt
Parameters
pathInput path.
Returns
The extension of path.

Definition at line 589 of file Path.cpp.

References filename(), llvm::StringRef::find_last_of(), llvm::StringRef::npos, llvm::StringRef::size(), and llvm::StringRef::substr().

Referenced by llvm::DWARFContext::dump(), llvm::symbolize::LLVMSymbolizer::flush(), has_extension(), and llvm::sys::path::reverse_iterator::operator*().

◆ filename()

StringRef llvm::sys::path::filename ( StringRef  path,
Style  style = Style::native 
)

◆ get_separator()

StringRef llvm::sys::path::get_separator ( Style  style = Style::native)

Return the preferred separator for this platform.

Returns
StringRef of the preferred separator, null-terminated.

Definition at line 610 of file Path.cpp.

Referenced by llvm::SourceMgr::AddIncludeFile(), EmitGenDwarfInfo(), and llvm::sys::path::reverse_iterator::operator*().

◆ has_extension()

bool llvm::sys::path::has_extension ( const Twine path,
Style  style = Style::native 
)

Has extension?

extension != ""

Parameters
pathInput path.
Returns
True if the path has a extension, false otherwise.

Definition at line 665 of file Path.cpp.

References llvm::StringRef::empty(), extension(), and llvm::Twine::toStringRef().

Referenced by llvm::sys::path::reverse_iterator::operator*(), and llvm::object::Parser::parse().

◆ has_filename()

bool llvm::sys::path::has_filename ( const Twine path,
Style  style = Style::native 
)

Has filename?

filename != ""

Parameters
pathInput path.
Returns
True if the path has a filename, false otherwise.

Definition at line 644 of file Path.cpp.

References llvm::StringRef::empty(), filename(), and llvm::Twine::toStringRef().

Referenced by llvm::sys::path::reverse_iterator::operator*().

◆ has_parent_path()

bool llvm::sys::path::has_parent_path ( const Twine path,
Style  style = Style::native 
)

Has parent path?

parent_path != ""

Parameters
pathInput path.
Returns
True if the path has a parent path, false otherwise.

Definition at line 651 of file Path.cpp.

References llvm::StringRef::empty(), parent_path(), and llvm::Twine::toStringRef().

Referenced by llvm::sys::path::reverse_iterator::operator*().

◆ has_relative_path()

bool llvm::sys::path::has_relative_path ( const Twine path,
Style  style = Style::native 
)

Has relative path?

relative_path != ""

Parameters
pathInput path.
Returns
True if the path has a relative path, false otherwise.

Definition at line 637 of file Path.cpp.

References llvm::StringRef::empty(), relative_path(), and llvm::Twine::toStringRef().

Referenced by llvm::sys::path::reverse_iterator::operator*().

◆ has_root_directory()

bool llvm::sys::path::has_root_directory ( const Twine path,
Style  style = Style::native 
)

Has root directory?

root_directory != ""

Parameters
pathInput path.
Returns
True if the path has a root directory, false otherwise.

Definition at line 623 of file Path.cpp.

References llvm::StringRef::empty(), root_directory(), and llvm::Twine::toStringRef().

Referenced by is_absolute(), llvm::sys::fs::make_absolute(), and llvm::sys::path::reverse_iterator::operator*().

◆ has_root_name()

bool llvm::sys::path::has_root_name ( const Twine path,
Style  style = Style::native 
)

Has root name?

root_name != ""

Parameters
pathInput path.
Returns
True if the path has a root name, false otherwise.

Definition at line 616 of file Path.cpp.

References llvm::StringRef::empty(), root_name(), and llvm::Twine::toStringRef().

Referenced by append(), is_absolute(), llvm::sys::fs::make_absolute(), and llvm::sys::path::reverse_iterator::operator*().

◆ has_root_path()

bool llvm::sys::path::has_root_path ( const Twine path,
Style  style = Style::native 
)

Has root path?

root_path != ""

Parameters
pathInput path.
Returns
True if the path has a root path, false otherwise.

Definition at line 630 of file Path.cpp.

References llvm::StringRef::empty(), root_path(), and llvm::Twine::toStringRef().

Referenced by llvm::sys::path::reverse_iterator::operator*().

◆ has_stem()

bool llvm::sys::path::has_stem ( const Twine path,
Style  style = Style::native 
)

Has stem?

stem != ""

Parameters
pathInput path.
Returns
True if the path has a stem, false otherwise.

Definition at line 658 of file Path.cpp.

References llvm::StringRef::empty(), stem(), and llvm::Twine::toStringRef().

Referenced by llvm::sys::path::reverse_iterator::operator*().

◆ home_directory()

bool llvm::sys::path::home_directory ( SmallVectorImpl< char > &  result)

Get the user's home directory.

Parameters
resultHolds the resulting path name.
Returns
True if a home directory is set, false otherwise.

Referenced by llvm::LineEditor::getDefaultHistoryPath(), native(), and llvm::sys::path::reverse_iterator::operator*().

◆ is_absolute()

bool llvm::sys::path::is_absolute ( const Twine path,
Style  style = Style::native 
)

◆ is_relative()

bool llvm::sys::path::is_relative ( const Twine path,
Style  style = Style::native 
)

Is path relative?

Parameters
pathInput path.
Returns
True if the path is relative, false if it is not.

Definition at line 683 of file Path.cpp.

References is_absolute().

Referenced by ExpandResponseFile(), llvm::DWARFUnit::getDWOId(), llvm::DWARFDebugLine::LineTable::getFileNameByIndex(), and llvm::sys::path::reverse_iterator::operator*().

◆ is_separator()

bool llvm::sys::path::is_separator ( char  value,
Style  style = Style::native 
)

Check whether the given char is a path separator on the host OS.

Parameters
valuea character
Returns
true if value is a path separator character on the host OS

Definition at line 602 of file Path.cpp.

Referenced by append(), native(), llvm::sys::path::reverse_iterator::operator*(), llvm::sys::path::const_iterator::operator++(), llvm::sys::path::reverse_iterator::operator++(), remove_leading_dotslash(), root_directory(), root_name(), root_path(), and llvm::stripDirPrefix().

◆ native() [1/2]

void llvm::sys::path::native ( const Twine path,
SmallVectorImpl< char > &  result,
Style  style = Style::native 
)

Convert path to the native form.

This is used to give paths to users and operating system calls in the platform's normal way. For example, on Windows all '/' are converted to '\'.

Parameters
pathA path that is transformed to native format.
resultHolds the result of the transformation.

Definition at line 531 of file Path.cpp.

References assert(), llvm::SmallVectorImpl< T >::clear(), llvm::StringRef::data(), llvm::SmallVectorTemplateCommon< T, typename >::data(), llvm::Twine::getSingleStringRef(), llvm::Twine::isSingleStringRef(), and llvm::Twine::toVector().

Referenced by llvm::pruneCache().

◆ native() [2/2]

void llvm::sys::path::native ( SmallVectorImpl< char > &  path,
Style  style = Style::native 
)

Convert path to the native form in place.

This is used to give paths to users and operating system calls in the platform's normal way. For example, on Windows all '/' are converted to '\'.

Parameters
pathA path that is transformed to native format.

Definition at line 541 of file Path.cpp.

References llvm::SmallString< InternalLen >::append(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), home_directory(), is_separator(), llvm::object::replace(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

◆ parent_path()

StringRef llvm::sys::path::parent_path ( StringRef  path,
Style  style = Style::native 
)

◆ rbegin()

reverse_iterator llvm::sys::path::rbegin ( StringRef  path,
Style  style = Style::native 
)

Get reverse begin iterator over path.

Parameters
pathInput path.
Returns
Iterator initialized with the first reverse component of path.

Definition at line 305 of file Path.cpp.

References I, and llvm::StringRef::size().

Referenced by filename(), llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::max_size(), and llvm::sys::path::reverse_iterator::operator*().

◆ relative_path()

StringRef llvm::sys::path::relative_path ( StringRef  path,
Style  style = Style::native 
)

Get relative path.

C:\hello\world => hello\world
foo/bar => foo/bar
/foo/bar => foo/bar
Parameters
pathInput path.
Returns
The path starting after root_path if one exists, otherwise "".

Definition at line 421 of file Path.cpp.

References root_path(), llvm::StringRef::size(), and llvm::StringRef::substr().

Referenced by llvm::symbolize::LLVMSymbolizer::flush(), has_relative_path(), llvm::sys::fs::make_absolute(), llvm::sys::path::reverse_iterator::operator*(), and remove_dots().

◆ remove_dots() [1/2]

bool llvm::sys::path::remove_dots ( SmallVectorImpl< char > &  path,
bool  remove_dot_dot = false,
Style  style = Style::native 
)

In-place remove any '.

/' and optionally '../' components from a path.

Parameters
pathprocessed path
remove_dot_dotspecify if '../' (except for leading "../") should be removed
Returns
True if path was changed

Definition at line 725 of file Path.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::data(), remove_dots(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::SmallVectorImpl< T >::swap().

Referenced by llvm::sys::path::reverse_iterator::operator*().

◆ remove_dots() [2/2]

static SmallString<256> llvm::sys::path::remove_dots ( StringRef  path,
bool  remove_dot_dot,
Style  style 
)
static

◆ remove_filename()

void llvm::sys::path::remove_filename ( SmallVectorImpl< char > &  path,
Style  style = Style::native 
)

Remove the last component from path unless it is the root dir.

directory/filename.cpp => directory/
directory/ => directory
filename.cpp => <empty>
/ => /
Parameters
pathA path that is modified to not have a file component.

Definition at line 483 of file Path.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::StringRef::npos, llvm::SmallVectorImpl< T >::set_size(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by llvm::symbolize::LLVMSymbolizer::flush(), and llvm::sys::path::reverse_iterator::operator*().

◆ remove_leading_dotslash()

StringRef llvm::sys::path::remove_leading_dotslash ( StringRef  path,
Style  style = Style::native 
)

Remove redundant leading "./" pieces and consecutive separators.

Parameters
pathInput path.
Returns
The cleaned-up path.

Definition at line 687 of file Path.cpp.

References is_separator(), llvm::StringRef::size(), and llvm::StringRef::substr().

Referenced by llvm::sys::path::reverse_iterator::operator*().

◆ rend()

reverse_iterator llvm::sys::path::rend ( StringRef  path)

Get reverse end iterator over path.

Parameters
pathInput path.
Returns
Iterator initialized to the reverse end of path.

Definition at line 313 of file Path.cpp.

References I, and llvm::StringRef::substr().

Referenced by llvm::iplist_impl< simple_ilist< MachineInstr, Options... >, ilist_traits< MachineInstr > >::max_size(), and llvm::sys::path::reverse_iterator::operator*().

◆ replace_extension()

void llvm::sys::path::replace_extension ( SmallVectorImpl< char > &  path,
const Twine extension,
Style  style = Style::native 
)

Replace the file extension of path with extension.

./filename.cpp => ./filename.extension
./filename => ./filename.extension
./ => ./.extension
Parameters
pathA path that has its extension replaced with extension.
extensionThe extension to be added. It may be empty. It may also optionally start with a '.', if it does not, one will be prepended.

Definition at line 489 of file Path.cpp.

References llvm::SmallVectorImpl< T >::append(), llvm::StringRef::begin(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::StringRef::end(), llvm::StringRef::find_last_of(), llvm::StringRef::npos, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorImpl< T >::set_size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::StringRef::size(), and llvm::Twine::toStringRef().

Referenced by getFunctionName(), getImplibPath(), getOutputPath(), and llvm::sys::path::reverse_iterator::operator*().

◆ replace_path_prefix()

void llvm::sys::path::replace_path_prefix ( SmallVectorImpl< char > &  Path,
const StringRef OldPrefix,
const StringRef NewPrefix,
Style  style = Style::native 
)

Replace matching path prefix with another path.

/foo, /old, /new => /foo
/old/foo, /old, /new => /new/foo
/foo, <empty>, /new => /new/foo
/old/foo, /old, <empty> => /foo
Parameters
PathIf Path starts with OldPrefix modify to instead start with NewPrefix.
OldPrefixThe path prefix to strip from Path.
NewPrefixThe path prefix to replace NewPrefix with.

Definition at line 508 of file Path.cpp.

References append(), llvm::StringRef::begin(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::StringRef::empty(), llvm::StringRef::end(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::StringRef::size(), llvm::StringRef::substr(), and llvm::SmallVectorImpl< T >::swap().

Referenced by llvm::lto::getThinLTOOutputFile(), and llvm::sys::path::reverse_iterator::operator*().

◆ root_directory()

StringRef llvm::sys::path::root_directory ( StringRef  path,
Style  style = Style::native 
)

Get root directory.

/goo/hello => /
c:/hello => /
d/file.txt => <empty>
Parameters
pathInput path.
Returns
The root directory of path if it has one, otherwise "".

Definition at line 398 of file Path.cpp.

References begin(), end(), and is_separator().

Referenced by has_root_directory(), llvm::sys::fs::make_absolute(), and llvm::sys::path::reverse_iterator::operator*().

◆ root_name()

StringRef llvm::sys::path::root_name ( StringRef  path,
Style  style = Style::native 
)

Get root name.

//net/hello => //net
c:/hello => c: (on Windows, on other platforms nothing)
/hello => <empty>
Parameters
pathInput path.
Returns
The root name of path if it has one, otherwise "".

Definition at line 381 of file Path.cpp.

References begin(), end(), and is_separator().

Referenced by has_root_name(), llvm::sys::fs::make_absolute(), and llvm::sys::path::reverse_iterator::operator*().

◆ root_path()

StringRef llvm::sys::path::root_path ( StringRef  path,
Style  style = Style::native 
)

Get root path.

Equivalent to root_name + root_directory.

Parameters
pathInput path.
Returns
The root path of path if it has one, otherwise "".

Definition at line 355 of file Path.cpp.

References begin(), end(), is_separator(), and llvm::StringRef::substr().

Referenced by has_root_path(), llvm::sys::path::reverse_iterator::operator*(), relative_path(), and remove_dots().

◆ stem()

StringRef llvm::sys::path::stem ( StringRef  path,
Style  style = Style::native 
)

Get stem.

If filename contains a dot but not solely one or two dots, result is the substring of filename ending at (but not including) the last dot. Otherwise it is filename.

/foo/bar.txt => bar
/foo/bar => bar
/foo/.txt => <empty>
/foo/. => .
/foo/.. => ..
Parameters
pathInput path.
Returns
The stem of path.

Definition at line 576 of file Path.cpp.

References filename(), llvm::StringRef::find_last_of(), llvm::StringRef::npos, llvm::StringRef::size(), and llvm::StringRef::substr().

Referenced by has_stem(), and llvm::sys::path::reverse_iterator::operator*().

◆ system_temp_directory()

void llvm::sys::path::system_temp_directory ( bool  erasedOnReboot,
SmallVectorImpl< char > &  result 
)

Get the typical temporary directory for the system, e.g., "/var/tmp" or "C:/TEMP".

Parameters
erasedOnRebootWhether to favor a path that is erased on reboot rather than one that potentially persists longer. This parameter will be ignored if the user or system has set the typical environment variable (e.g., TEMP on Windows, TMPDIR on *nix) to specify a temporary directory.
resultHolds the resulting path name.

Referenced by createUniqueEntity(), and llvm::sys::path::reverse_iterator::operator*().

◆ user_cache_directory()

bool llvm::sys::path::user_cache_directory ( SmallVectorImpl< char > &  Result,
const Twine Path1,
const Twine Path2 = "",
const Twine Path3 = "" 
)

Get the user's cache directory.

Expect the resulting path to be a directory shared with other applications/services used by the user. Params Path1 to Path3 can be used to append additional directory names to the resulting path. Recommended pattern is <user_cache_directory>/<vendor>/<application>.

Parameters
ResultHolds the resulting path.
Path1Additional path to be appended to the user's cache directory path. "" can be used to append nothing.
Path2Second additional path to be appended.
Path3Third additional path to be appended.
Returns
True if a cache directory path is set, false otherwise.

Definition at line 1052 of file Path.cpp.

References append().

Referenced by llvm::sys::path::reverse_iterator::operator*().

◆ widenPath()

std::error_code llvm::sys::path::widenPath ( const Twine Path8,
SmallVectorImpl< wchar_t > &  Path16 
)

Referenced by llvm::sys::toFILETIME().