LLDB mainline
lldb_private::ClangModulesDeclVendor Class Referenceabstract

#include <ClangModulesDeclVendor.h>

Inheritance diagram for lldb_private::ClangModulesDeclVendor:
[legend]

Public Types

typedef std::vector< ConstStringModulePath
typedef uintptr_t ModuleID
typedef std::vector< ModuleIDModuleVector
Public Types inherited from lldb_private::DeclVendor
enum  DeclVendorKind { eClangDeclVendor , eClangModuleDeclVendor , eAppleObjCDeclVendor , eLastClangDeclVendor }

Public Member Functions

 ClangModulesDeclVendor ()
 ~ClangModulesDeclVendor () override
virtual bool AddModule (const SourceModule &module, ModuleVector *exported_modules, Stream &error_stream)=0
 Add a module to the list of modules to search.
virtual bool AddModulesForCompileUnit (CompileUnit &cu, ModuleVector &exported_modules, Stream &error_stream)=0
 Add all modules referred to in a given compilation unit to the list of modules to search.
virtual void ForEachMacro (const ModuleVector &modules, std::function< bool(llvm::StringRef, llvm::StringRef)> handler)=0
 Enumerate all the macros that are defined by a given set of modules that are already imported.
Public Member Functions inherited from lldb_private::ClangDeclVendor
 ClangDeclVendor (DeclVendorKind kind)
 ~ClangDeclVendor () override=default
uint32_t FindDecls (ConstString name, bool append, uint32_t max_matches, std::vector< clang::NamedDecl * > &decls)
virtual uint32_t FindDecls (ConstString name, bool append, uint32_t max_matches, std::vector< CompilerDecl > &decls)=0
 Look up the set of Decls that the DeclVendor currently knows about matching a given name.
Public Member Functions inherited from lldb_private::DeclVendor
 DeclVendor (DeclVendorKind kind)
virtual ~DeclVendor ()=default
DeclVendorKind GetKind () const
std::vector< CompilerTypeFindTypes (ConstString name, uint32_t max_matches)
 Look up the types that the DeclVendor currently knows about matching a given name.

Static Public Member Functions

static bool classof (const DeclVendor *vendor)
static ClangModulesDeclVendorCreate (Target &target)
static bool LanguageSupportsClangModules (lldb::LanguageType language)
 Query whether Clang supports modules for a particular language.
Static Public Member Functions inherited from lldb_private::ClangDeclVendor
static bool classof (const DeclVendor *vendor)

Detailed Description

Definition at line 22 of file ClangModulesDeclVendor.h.

Member Typedef Documentation

◆ ModuleID

Definition at line 36 of file ClangModulesDeclVendor.h.

◆ ModulePath

◆ ModuleVector

Constructor & Destructor Documentation

◆ ClangModulesDeclVendor()

ClangModulesDeclVendor::ClangModulesDeclVendor ( )

◆ ~ClangModulesDeclVendor()

ClangModulesDeclVendor::~ClangModulesDeclVendor ( )
overridedefault

Member Function Documentation

◆ AddModule()

virtual bool lldb_private::ClangModulesDeclVendor::AddModule ( const SourceModule & module,
ModuleVector * exported_modules,
Stream & error_stream )
pure virtual

Add a module to the list of modules to search.

Parameters
[in]moduleThe path to the exact module to be loaded. E.g., if the desired module is std.io, then this should be { "std", "io" }.
[in]exported_modulesIf non-NULL, a pointer to a vector to populate with the ID of every module that is re-exported by the specified module.
[in]error_streamA stream to populate with the output of the Clang parser when it tries to load the module.
Returns
True if the module could be loaded; false if not. If the compiler encountered a fatal error during a previous module load, then this will always return false for this ModuleImporter.

◆ AddModulesForCompileUnit()

virtual bool lldb_private::ClangModulesDeclVendor::AddModulesForCompileUnit ( CompileUnit & cu,
ModuleVector & exported_modules,
Stream & error_stream )
pure virtual

Add all modules referred to in a given compilation unit to the list of modules to search.

Parameters
[in]cuThe compilation unit to scan for imported modules.
[in]exported_modulesA vector to populate with the ID of each module loaded (directly and via re-exports) in this way.
[in]error_streamA stream to populate with the output of the Clang parser when it tries to load the modules.
Returns
True if all modules referred to by the compilation unit could be loaded; false if one could not be loaded. If the compiler encountered a fatal error during a previous module load, then this will always return false for this ModuleImporter.

◆ classof()

bool lldb_private::ClangModulesDeclVendor::classof ( const DeclVendor * vendor)
inlinestatic

◆ Create()

◆ ForEachMacro()

virtual void lldb_private::ClangModulesDeclVendor::ForEachMacro ( const ModuleVector & modules,
std::function< bool(llvm::StringRef, llvm::StringRef)> handler )
pure virtual

Enumerate all the macros that are defined by a given set of modules that are already imported.

Parameters
[in]modulesThe unique IDs for all modules to query. Later modules have higher priority, just as if you @imported them in that order. This matters if module A #defines a macro and module B #undefs it.
[in]handlerA function to call with the identifier of this macro and the text of each #define (including the #define directive). #undef directives are not included; we simply elide any corresponding #define. If this function returns true, we stop the iteration immediately.

◆ LanguageSupportsClangModules()

bool ClangModulesDeclVendor::LanguageSupportsClangModules ( lldb::LanguageType language)
static

Query whether Clang supports modules for a particular language.

LLDB uses this to decide whether to try to find the modules loaded by a given compile unit.

Parameters
[in]languageThe language to query for.
Returns
True if Clang has modules for the given language.

Definition at line 408 of file ClangModulesDeclVendor.cpp.

References lldb::eLanguageTypeC, lldb::eLanguageTypeC11, lldb::eLanguageTypeC89, lldb::eLanguageTypeC99, lldb::eLanguageTypeC_plus_plus, lldb::eLanguageTypeC_plus_plus_03, lldb::eLanguageTypeC_plus_plus_11, lldb::eLanguageTypeC_plus_plus_14, lldb::eLanguageTypeObjC, and lldb::eLanguageTypeObjC_plus_plus.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::ParseImportedModules().


The documentation for this class was generated from the following files: