forked from OSchip/llvm-project
parent
eff88e42f7
commit
330014843c
|
@ -26,15 +26,14 @@ class Variable : public UserID, public std::enable_shared_from_this<Variable> {
|
|||
public:
|
||||
typedef RangeVector<lldb::addr_t, lldb::addr_t> RangeList;
|
||||
|
||||
// Constructors and Destructors
|
||||
Variable(lldb::user_id_t uid, const char *name,
|
||||
const char
|
||||
*mangled, // The mangled or fully qualified name of the variable.
|
||||
const lldb::SymbolFileTypeSP &symfile_type_sp,
|
||||
lldb::ValueType scope, SymbolContextScope *owner_scope,
|
||||
const RangeList &scope_range, Declaration *decl,
|
||||
const DWARFExpression &location, bool external, bool artificial,
|
||||
bool static_member = false);
|
||||
/// Constructors and Destructors.
|
||||
///
|
||||
/// \param mangled The mangled or fully qualified name of the variable.
|
||||
Variable(lldb::user_id_t uid, const char *name, const char *mangled,
|
||||
const lldb::SymbolFileTypeSP &symfile_type_sp, lldb::ValueType scope,
|
||||
SymbolContextScope *owner_scope, const RangeList &scope_range,
|
||||
Declaration *decl, const DWARFExpression &location, bool external,
|
||||
bool artificial, bool static_member = false);
|
||||
|
||||
virtual ~Variable();
|
||||
|
||||
|
@ -50,11 +49,11 @@ public:
|
|||
|
||||
SymbolContextScope *GetSymbolContextScope() const { return m_owner_scope; }
|
||||
|
||||
// Since a variable can have a basename "i" and also a mangled named
|
||||
// "_ZN12_GLOBAL__N_11iE" and a demangled mangled name "(anonymous
|
||||
// namespace)::i", this function will allow a generic match function that can
|
||||
// be called by commands and expression parsers to make sure we match
|
||||
// anything we come across.
|
||||
/// Since a variable can have a basename "i" and also a mangled named
|
||||
/// "_ZN12_GLOBAL__N_11iE" and a demangled mangled name "(anonymous
|
||||
/// namespace)::i", this function will allow a generic match function that can
|
||||
/// be called by commands and expression parsers to make sure we match
|
||||
/// anything we come across.
|
||||
bool NameMatches(ConstString name) const;
|
||||
|
||||
bool NameMatches(const RegularExpression ®ex) const;
|
||||
|
@ -107,26 +106,34 @@ public:
|
|||
CompilerDecl GetDecl();
|
||||
|
||||
protected:
|
||||
ConstString m_name; // The basename of the variable (no namespaces)
|
||||
Mangled m_mangled; // The mangled name of the variable
|
||||
lldb::SymbolFileTypeSP m_symfile_type_sp; // The type pointer of the variable
|
||||
// (int, struct, class, etc)
|
||||
lldb::ValueType m_scope; // global, parameter, local
|
||||
SymbolContextScope
|
||||
*m_owner_scope; // The symbol file scope that this variable was defined in
|
||||
RangeList m_scope_range; // The list of ranges inside the owner's scope where
|
||||
// this variable is valid
|
||||
Declaration m_declaration; // Declaration location for this item.
|
||||
DWARFExpression m_location; // The location of this variable that can be fed
|
||||
// to DWARFExpression::Evaluate()
|
||||
uint8_t m_external : 1, // Visible outside the containing compile unit?
|
||||
m_artificial : 1, // Non-zero if the variable is not explicitly declared
|
||||
// in source
|
||||
m_loc_is_const_data : 1, // The m_location expression contains the
|
||||
// constant variable value data, not a DWARF
|
||||
// location
|
||||
m_static_member : 1; // Non-zero if variable is static member of a class
|
||||
// or struct.
|
||||
/// The basename of the variable (no namespaces).
|
||||
ConstString m_name;
|
||||
/// The mangled name of the variable.
|
||||
Mangled m_mangled;
|
||||
/// The type pointer of the variable (int, struct, class, etc)
|
||||
/// global, parameter, local.
|
||||
lldb::SymbolFileTypeSP m_symfile_type_sp;
|
||||
lldb::ValueType m_scope;
|
||||
/// The symbol file scope that this variable was defined in
|
||||
SymbolContextScope *m_owner_scope;
|
||||
/// The list of ranges inside the owner's scope where this variable
|
||||
/// is valid.
|
||||
RangeList m_scope_range;
|
||||
/// Declaration location for this item.
|
||||
Declaration m_declaration;
|
||||
/// The location of this variable that can be fed to
|
||||
/// DWARFExpression::Evaluate().
|
||||
DWARFExpression m_location;
|
||||
/// Visible outside the containing compile unit?
|
||||
unsigned m_external : 1;
|
||||
/// Non-zero if the variable is not explicitly declared in source.
|
||||
unsigned m_artificial : 1;
|
||||
/// The m_location expression contains the constant variable value
|
||||
/// data, not a DWARF location.
|
||||
unsigned m_loc_is_const_data : 1;
|
||||
/// Non-zero if variable is static member of a class or struct.
|
||||
unsigned m_static_member : 1;
|
||||
|
||||
private:
|
||||
Variable(const Variable &rhs) = delete;
|
||||
Variable &operator=(const Variable &rhs) = delete;
|
||||
|
|
|
@ -35,14 +35,12 @@
|
|||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
// Variable constructor
|
||||
Variable::Variable(
|
||||
lldb::user_id_t uid, const char *name,
|
||||
const char *mangled, // The mangled or fully qualified name of the variable.
|
||||
const lldb::SymbolFileTypeSP &symfile_type_sp, ValueType scope,
|
||||
SymbolContextScope *context, const RangeList &scope_range,
|
||||
Declaration *decl_ptr, const DWARFExpression &location, bool external,
|
||||
bool artificial, bool static_member)
|
||||
Variable::Variable(lldb::user_id_t uid, const char *name, const char *mangled,
|
||||
const lldb::SymbolFileTypeSP &symfile_type_sp,
|
||||
ValueType scope, SymbolContextScope *context,
|
||||
const RangeList &scope_range, Declaration *decl_ptr,
|
||||
const DWARFExpression &location, bool external,
|
||||
bool artificial, bool static_member)
|
||||
: UserID(uid), m_name(name), m_mangled(ConstString(mangled)),
|
||||
m_symfile_type_sp(symfile_type_sp), m_scope(scope),
|
||||
m_owner_scope(context), m_scope_range(scope_range),
|
||||
|
@ -50,7 +48,6 @@ Variable::Variable(
|
|||
m_artificial(artificial), m_loc_is_const_data(false),
|
||||
m_static_member(static_member) {}
|
||||
|
||||
// Destructor
|
||||
Variable::~Variable() {}
|
||||
|
||||
lldb::LanguageType Variable::GetLanguage() const {
|
||||
|
|
Loading…
Reference in New Issue