#pragma once #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringMap.h" #include "llvm/Support/Allocator.h" #include "clang/Tooling/CompilationDatabase.h" namespace clice { class CommandManager { public: /// FIXME: support multiple compilation databases. CommandManager(llvm::StringRef path); llvm::ArrayRef lookup(llvm::StringRef file); // TODO: add a function for scaning module dependencies. struct Data { std::uint64_t index; std::uint64_t size; }; private: std::vector args; llvm::BumpPtrAllocator allocator; llvm::StringMap cache; /// module name -> file path llvm::StringMap moduleMap; std::unique_ptr CDB; }; } // namespace clice