Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang-tools-extra/clangd/ConfigProvider.cpp
Show All 37 Lines | public: | ||||
void get(const ThreadsafeFS &TFS, DiagnosticCallback DC, | void get(const ThreadsafeFS &TFS, DiagnosticCallback DC, | ||||
std::chrono::steady_clock::time_point FreshTime, bool Trusted, | std::chrono::steady_clock::time_point FreshTime, bool Trusted, | ||||
std::vector<CompiledFragment> &Out) const { | std::vector<CompiledFragment> &Out) const { | ||||
read( | read( | ||||
TFS, FreshTime, | TFS, FreshTime, | ||||
[&](std::optional<llvm::StringRef> Data) { | [&](std::optional<llvm::StringRef> Data) { | ||||
CachedValue.clear(); | CachedValue.clear(); | ||||
if (Data) | if (Data) | ||||
for (auto &Fragment : Fragment::parseYAML(*Data, path(), DC)) { | for (auto &Fragment : | ||||
Fragment::parseYAML(*Data, path(), Directory, DC)) { | |||||
Fragment.Source.Directory = Directory; | Fragment.Source.Directory = Directory; | ||||
Fragment.Source.Trusted = Trusted; | Fragment.Source.Trusted = Trusted; | ||||
CachedValue.push_back(std::move(Fragment).compile(DC)); | CachedValue.push_back(std::move(Fragment).compile(DC)); | ||||
} | } | ||||
}, | }, | ||||
[&]() { llvm::copy(CachedValue, std::back_inserter(Out)); }); | [&]() { llvm::copy(CachedValue, std::back_inserter(Out)); }); | ||||
} | } | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines |