LLDB  mainline
ModuleDependencyCollector.h
Go to the documentation of this file.
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 LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_MODULEDEPENDENCYCOLLECTOR_H
10 #define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_MODULEDEPENDENCYCOLLECTOR_H
11 
12 #include "clang/Frontend/Utils.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/FileCollector.h"
15 
16 namespace lldb_private {
18  : public clang::ModuleDependencyCollector {
19 public:
21  std::shared_ptr<llvm::FileCollectorBase> file_collector)
22  : clang::ModuleDependencyCollector(""), m_file_collector(file_collector) {
23  }
24 
25  void addFile(llvm::StringRef Filename,
26  llvm::StringRef FileDst = {}) override {
27  if (m_file_collector)
28  m_file_collector->addFile(Filename);
29  }
30 
31  bool insertSeen(llvm::StringRef Filename) override { return false; }
32  void addFileMapping(llvm::StringRef VPath, llvm::StringRef RPath) override {}
33  void writeFileMap() override {}
34 
35 private:
36  std::shared_ptr<llvm::FileCollectorBase> m_file_collector;
37 };
38 } // namespace lldb_private
39 
40 #endif
lldb_private::ModuleDependencyCollectorAdaptor::writeFileMap
void writeFileMap() override
Definition: ModuleDependencyCollector.h:33
lldb_private::ModuleDependencyCollectorAdaptor::ModuleDependencyCollectorAdaptor
ModuleDependencyCollectorAdaptor(std::shared_ptr< llvm::FileCollectorBase > file_collector)
Definition: ModuleDependencyCollector.h:20
lldb_private::ModuleDependencyCollectorAdaptor::addFile
void addFile(llvm::StringRef Filename, llvm::StringRef FileDst={}) override
Definition: ModuleDependencyCollector.h:25
lldb_private::ModuleDependencyCollectorAdaptor::insertSeen
bool insertSeen(llvm::StringRef Filename) override
Definition: ModuleDependencyCollector.h:31
clang
Definition: ASTResultSynthesizer.h:15
lldb_private::ModuleDependencyCollectorAdaptor::m_file_collector
std::shared_ptr< llvm::FileCollectorBase > m_file_collector
Definition: ModuleDependencyCollector.h:36
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ModuleDependencyCollectorAdaptor
Definition: ModuleDependencyCollector.h:17
lldb_private::ModuleDependencyCollectorAdaptor::addFileMapping
void addFileMapping(llvm::StringRef VPath, llvm::StringRef RPath) override
Definition: ModuleDependencyCollector.h:32