class CachedPathResolver
Declaration
class CachedPathResolver { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:32
Member Variables
- private StringMap<std::string> ResolvedPaths
Method Overview
- public llvm::StringRef resolve(const std::string & Path, llvm::NonRelocatableStringpool & StringPool)
Methods
ΒΆllvm::StringRef resolve(
const std::string& Path,
llvm::NonRelocatableStringpool& StringPool)
llvm::StringRef resolve(
const std::string& Path,
llvm::NonRelocatableStringpool& StringPool)
Description
Resolve a path by calling realpath and cache its result. The returned StringRef is interned in the given \p StringPool.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:36
Parameters
- const std::string& Path
- llvm::NonRelocatableStringpool& StringPool