Sean Callanan | c631b64 | 2014-12-05 01:26:42 +0000 | [diff] [blame] | 1 | //===-- 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 | |
| 20 | namespace lldb_private |
| 21 | { |
| 22 | |
| 23 | class ClangModulesDeclVendor : public DeclVendor |
| 24 | { |
| 25 | public: |
| 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 Callanan | b8bf6ef | 2015-04-14 18:36:17 +0000 | [diff] [blame] | 55 | |
Sean Callanan | 26760a8 | 2015-04-14 18:50:05 +0000 | [diff] [blame^] | 56 | //------------------------------------------------------------------ |
| 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 Callanan | b8bf6ef | 2015-04-14 18:36:17 +0000 | [diff] [blame] | 64 | virtual void |
| 65 | ForEachMacro(std::function<bool (const std::string &)> handler) = 0; |
Sean Callanan | c631b64 | 2014-12-05 01:26:42 +0000 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | } |
| 69 | #endif /* defined(_lldb_ClangModulesDeclVendor_) */ |