//===- CompilationDatabase.cpp - LSP Compilation Database -----------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "mlir/Tools/lsp-server-support/CompilationDatabase.h" #include "mlir/Support/FileUtilities.h" #include "mlir/Tools/lsp-server-support/Logging.h" #include "mlir/Tools/lsp-server-support/Protocol.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/YAMLTraits.h" usingnamespacemlir; usingnamespacemlir::lsp; //===----------------------------------------------------------------------===// // YamlFileInfo //===----------------------------------------------------------------------===// namespace { struct YamlFileInfo { … }; } // namespace //===----------------------------------------------------------------------===// // CompilationDatabase //===----------------------------------------------------------------------===// LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(…) namespace llvm { namespace yaml { template <> struct MappingTraits<YamlFileInfo> { … }; } // end namespace yaml } // end namespace llvm CompilationDatabase::CompilationDatabase(ArrayRef<std::string> databases) { … } const CompilationDatabase::FileInfo & CompilationDatabase::getFileInfo(StringRef filename) const { … } void CompilationDatabase::loadDatabase(StringRef filename) { … }