MCPcopy Create free account
hub / github.com/Kitware/CMake / cleanPath

Function cleanPath

Utilities/ClangTidyModule/UsePragmaOnceCheck.cxx:32–37  ·  view source on GitHub ↗

canonicalize a path by removing ./ and ../ components.

Source from the content-addressed store, hash-verified

30
31/// canonicalize a path by removing ./ and ../ components.
32static std::string cleanPath(StringRef Path)
33{
34 SmallString<256> Result = Path;
35 llvm::sys::path::remove_dots(Result, true);
36 return std::string(Result.str());
37}
38
39namespace {
40// This class is a workaround for the fact that PPCallbacks doesn't give us the

Callers 3

FileChangedMethod · 0.85
EndOfMainFileMethod · 0.85
addBinaryPathMethod · 0.85

Calls 1

strMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…