LLVM 20.0.0git
|
Small helper that resolves and caches file paths. More...
#include "llvm/DWARFLinker/Classic/DWARFLinkerDeclContext.h"
Public Member Functions | |
StringRef | resolve (const std::string &Path, NonRelocatableStringpool &StringPool) |
Resolve a path by calling realpath and cache its result. | |
Small helper that resolves and caches file paths.
This helps reduce the number of calls to realpath which is expensive. We assume the input are files, and cache the realpath of their parent. This way we can quickly resolve different files under the same path.
Definition at line 34 of file DWARFLinkerDeclContext.h.
|
inline |
Resolve a path by calling realpath and cache its result.
The returned StringRef is interned in the given StringPool
.
Definition at line 38 of file DWARFLinkerDeclContext.h.
References llvm::sys::path::append(), llvm::sys::path::filename(), llvm::sys::path::parent_path(), llvm::sys::fs::real_path(), and llvm::StringMap< ValueTy, AllocatorTy >::try_emplace().