MCPcopy Create free account
hub / github.com/MobileNativeFoundation/index-import / getUnitPathForOutputFile

Function getUnitPathForOutputFile

index-import.cpp:125–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void getUnitPathForOutputFile(StringRef unitsPath, StringRef filePath,
126 SmallVectorImpl<char> &str,
127 const PathRemapper &clangPathRemapper,
128 FileManager &fileMgr) {
129 str.append(unitsPath.begin(), unitsPath.end());
130 str.push_back('/');
131 SmallString<256> absPath(filePath);
132 fileMgr.makeAbsolutePath(absPath);
133 StringRef fname = sys::path::filename(absPath);
134 str.append(fname.begin(), fname.end());
135 str.push_back('-');
136 clangPathRemapper.remapPath(absPath);
137 uint64_t pathHashVal = llvm::xxh3_64bits(absPath);
138 llvm::APInt(64, pathHashVal).toStringUnsigned(str, /*Radix*/ 36);
139}
140
141std::optional<bool>
142isUnitUpToDateForOutputFile(StringRef unitsPath, StringRef filePath,

Callers 2

remapIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected