ModuleDependencyCollector.h revision 351400
1//===-- ModuleDependencyCollector.h -----------------------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef liblldb_ModuleDependencyCollector_h_
10#define liblldb_ModuleDependencyCollector_h_
11
12#include "lldb/Utility/FileCollector.h"
13#include "clang/Frontend/Utils.h"
14#include "llvm/ADT/StringRef.h"
15
16namespace lldb_private {
17class ModuleDependencyCollectorAdaptor
18    : public clang::ModuleDependencyCollector {
19public:
20  ModuleDependencyCollectorAdaptor(FileCollector &file_collector)
21      : clang::ModuleDependencyCollector(""), m_file_collector(file_collector) {
22  }
23
24  void addFile(llvm::StringRef Filename,
25               llvm::StringRef FileDst = {}) override {
26    m_file_collector.AddFile(Filename);
27  }
28
29  bool insertSeen(llvm::StringRef Filename) override { return false; }
30  void addFileMapping(llvm::StringRef VPath, llvm::StringRef RPath) override {}
31  void writeFileMap() override {}
32
33private:
34  FileCollector &m_file_collector;
35};
36} // namespace lldb_private
37
38#endif
39