1 //===-- ModuleDependencyCollector.h -----------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_ModuleDependencyCollector_h_
10 #define liblldb_ModuleDependencyCollector_h_
12 #include "lldb/Utility/FileCollector.h"
13 #include "clang/Frontend/Utils.h"
14 #include "llvm/ADT/StringRef.h"
16 namespace lldb_private {
17 class ModuleDependencyCollectorAdaptor
18 : public clang::ModuleDependencyCollector {
20 ModuleDependencyCollectorAdaptor(FileCollector &file_collector)
21 : clang::ModuleDependencyCollector(""), m_file_collector(file_collector) {
24 void addFile(llvm::StringRef Filename,
25 llvm::StringRef FileDst = {}) override {
26 m_file_collector.AddFile(Filename);
29 bool insertSeen(llvm::StringRef Filename) override { return false; }
30 void addFileMapping(llvm::StringRef VPath, llvm::StringRef RPath) override {}
31 void writeFileMap() override {}
34 FileCollector &m_file_collector;
36 } // namespace lldb_private