9#ifndef LLDB_SYMBOL_COMPILEUNIT_H
10#define LLDB_SYMBOL_COMPILEUNIT_H
24#include "llvm/ADT/DenseMap.h"
25#include "llvm/ADT/DenseSet.h"
40class CompileUnit :
public std::enable_shared_from_this<CompileUnit>,
190 void Dump(
Stream *s,
bool show_context)
const;
228 const FileSpec *file_spec_ptr,
bool exact,
270 llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
271 llvm::function_ref<
bool(
Module &)> lambda);
400 lldb::SymbolContextItem resolve_scope,
A class that describes a compilation unit.
void SetVariableList(lldb::VariableListSP &variable_list_sp)
Set accessor for the variable list.
void Dump(Stream *s, bool show_context) const
Dump the compile unit contents to the stream s.
const SupportFileList & GetSupportFiles()
Get the compile unit's support file list.
lldb::SupportFileSP GetPrimarySupportFile() const
Return the primary source file associated with this compile unit.
lldb::LanguageType m_language
The programming language enumeration value.
SupportFileList & GetSupportFileList()
Used by plugins that parse the support file list.
lldb::SupportFileSP m_primary_support_file_sp
The primary file associated with this compile unit.
const std::vector< SourceModule > & GetImportedModules()
Get the compile unit's imported module list.
lldb::VariableListSP GetVariableList(bool can_create)
Get the variable list for a compile unit.
lldb_private::LazyBool m_is_optimized
eLazyBoolYes if this compile unit was compiled with optimization.
void SetDebugMacros(const DebugMacrosSP &debug_macros)
const FileSpec & GetPrimaryFile() const
Return the primary source spec associated with this compile unit.
void SetLanguage(lldb::LanguageType language)
void ForeachFunction(llvm::function_ref< bool(const lldb::FunctionSP &)> lambda) const
Apply a lambda to each function in this compile unit.
@ flagsParsedVariables
Have we already parsed globals and statics?
@ flagsParsedLanguage
Have we parsed the language already?
@ flagsParsedSupportFiles
Have we already parsed the support files for this compile unit?
@ flagsParsedImportedModules
Have we parsed the imported modules already?
@ flagsParsedDebugMacros
Have we parsed the debug macros already?
@ flagsParsedAllFunctions
Have we already parsed all our functions.
@ flagsParsedLineTable
Have we parsed the line table already?
Flags m_flags
Compile unit flags that help with partial parsing.
lldb::FunctionSP FindFunction(llvm::function_ref< bool(const lldb::FunctionSP &)> matching_lambda)
Find a function in the compile unit based on the predicate matching_lambda.
void * GetUserData() const
Get the SymbolFile plug-in user data.
bool GetIsOptimized()
Get whether compiler optimizations were enabled for this compile unit.
void CalculateSymbolContext(SymbolContext *sc) override
Reconstruct the object's symbol context into sc.
lldb::ModuleSP CalculateSymbolContextModule() override
void ResolveSymbolContext(const SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list, RealpathPrefixes *realpath_prefixes=nullptr)
Resolve symbol contexts by file and line.
DebugMacros * GetDebugMacros()
void SetLineTable(LineTable *line_table)
Set the line table for the compile unit.
virtual bool ForEachExternalModule(llvm::DenseSet< lldb_private::SymbolFile * > &visited_symbol_files, llvm::function_ref< bool(Module &)> lambda)
Apply a lambda to each external lldb::Module referenced by this compilation unit.
void DumpSymbolContext(Stream *s) override
Dump the object's symbol context to the stream s.
void AddFunction(lldb::FunctionSP &function_sp)
Add a function to this compile unit.
lldb::FunctionSP FindFunctionByUID(lldb::user_id_t uid)
Finds a function by user ID.
DebugMacrosSP m_debug_macros_sp
Debug macros that will get parsed on demand.
std::unique_ptr< LineTable > m_line_table_up
Line table that will get parsed on demand.
const char * GetCachedLanguage() const
CompileUnit * CalculateSymbolContextCompileUnit() override
CompileUnit(const CompileUnit &)=delete
SupportFileList m_support_files
Files associated with this compile unit's line table and declarations.
lldb::VariableListSP m_variables
Global and static variable list that will get parsed on demand.
uint32_t FindLineEntry(uint32_t start_idx, uint32_t line, const FileSpec *file_spec_ptr, bool exact, LineEntry *line_entry)
Find the line entry by line and optional inlined file spec.
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
size_t GetNumFunctions() const
Returns the number of functions in this compile unit.
std::vector< SourceModule > m_imported_modules
All modules, including the current module, imported by this compile unit.
const CompileUnit & operator=(const CompileUnit &)=delete
lldb::LanguageType GetLanguage()
llvm::DenseMap< lldb::user_id_t, lldb::FunctionSP > m_functions_by_uid
Maps UIDs to functions.
LineTable * GetLineTable()
Get the line table for the compile unit.
void * m_user_data
User data for the SymbolFile parser to store information into.
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
A mix in class that contains a pointer back to the module that owns the object which inherits from it...
A class that describes an executable image and its associated object and symbol files.
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
A stream class that can stream formatted output to a file.
A list of support files for a CompileUnit.
Defines a list of symbol context objects.
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Defines a symbol context baton that can be handed other debug core functions.
A class that represents a running process on the host machine.
std::shared_ptr< DebugMacros > DebugMacrosSP
std::shared_ptr< lldb_private::Function > FunctionSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::SupportFile > SupportFileSP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::VariableList > VariableListSP
std::shared_ptr< lldb_private::Module > ModuleSP
A line table entry class.
A mix in class that contains a generic user ID.