blob: 5bc383db1b899c5467834d86ae7f30437b191ec5 [file] [log] [blame]
Sean Callananc631b642014-12-05 01:26:42 +00001//===-- ClangModulesDeclVendor.h --------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _liblldb_ClangModulesDeclVendor_
11#define _liblldb_ClangModulesDeclVendor_
12
13#include "lldb/Core/ArchSpec.h"
14#include "lldb/Core/ClangForward.h"
15#include "lldb/Symbol/DeclVendor.h"
16#include "lldb/Target/Platform.h"
17
18#include <vector>
19
20namespace lldb_private
21{
22
23class ClangModulesDeclVendor : public DeclVendor
24{
25public:
26 //------------------------------------------------------------------
27 // Constructors and Destructors
28 //------------------------------------------------------------------
29 ClangModulesDeclVendor();
30
31 virtual
32 ~ClangModulesDeclVendor();
33
34 static ClangModulesDeclVendor *
35 Create(Target &target);
36
37 //------------------------------------------------------------------
38 /// Add a module to the list of modules to search.
39 ///
40 /// @param[in] path
41 /// The path to the exact module to be loaded. E.g., if the desired
42 /// module is std.io, then this should be { "std", "io" }.
43 ///
44 /// @param[in] error_stream
45 /// A stream to populate with the output of the Clang parser when
46 /// it tries to load the module.
47 ///
48 /// @return
49 /// True if the module could be loaded; false if not. If the
50 /// compiler encountered a fatal error during a previous module
51 /// load, then this will always return false for this ModuleImporter.
52 //------------------------------------------------------------------
53 virtual bool
54 AddModule(std::vector<llvm::StringRef> &path, Stream &error_stream) = 0;
Sean Callananb8bf6ef2015-04-14 18:36:17 +000055
Sean Callanan26760a82015-04-14 18:50:05 +000056 //------------------------------------------------------------------
57 /// Enumerate all the macros that are currently visible.
58 ///
59 /// @param[in] handler
60 /// A function that receives the text of each #define macro.
61 /// If handler returns true, this function returns immediately,
62 /// without calling handler again.
63 //------------------------------------------------------------------
Sean Callananb8bf6ef2015-04-14 18:36:17 +000064 virtual void
65 ForEachMacro(std::function<bool (const std::string &)> handler) = 0;
Sean Callananc631b642014-12-05 01:26:42 +000066};
67
68}
69#endif /* defined(_lldb_ClangModulesDeclVendor_) */