]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Symbol/VariableList.h
Merge clang trunk r338150, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Symbol / VariableList.h
1 //===-- VariableList.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_VariableList_h_
11 #define liblldb_VariableList_h_
12
13 #include "lldb/Symbol/SymbolContext.h"
14 #include "lldb/Symbol/Variable.h"
15 #include "lldb/lldb-private.h"
16
17 namespace lldb_private {
18
19 class VariableList {
20 public:
21   //------------------------------------------------------------------
22   // Constructors and Destructors
23   //------------------------------------------------------------------
24   //  VariableList(const SymbolContext &symbol_context);
25   VariableList();
26   virtual ~VariableList();
27
28   void AddVariable(const lldb::VariableSP &var_sp);
29
30   bool AddVariableIfUnique(const lldb::VariableSP &var_sp);
31
32   void AddVariables(VariableList *variable_list);
33
34   void Clear();
35
36   void Dump(Stream *s, bool show_context) const;
37
38   lldb::VariableSP GetVariableAtIndex(size_t idx) const;
39
40   lldb::VariableSP RemoveVariableAtIndex(size_t idx);
41
42   lldb::VariableSP FindVariable(const ConstString &name,
43                                 bool include_static_members = true);
44
45   lldb::VariableSP FindVariable(const ConstString &name,
46                                 lldb::ValueType value_type,
47                                 bool include_static_members = true);
48
49   uint32_t FindVariableIndex(const lldb::VariableSP &var_sp);
50
51   size_t AppendVariablesIfUnique(VariableList &var_list);
52
53   // Returns the actual number of unique variables that were added to the
54   // list. "total_matches" will get updated with the actually number of
55   // matches that were found regardless of whether they were unique or not
56   // to allow for error conditions when nothing is found, versus conditions
57   // where any variables that match "regex" were already in "var_list".
58   size_t AppendVariablesIfUnique(const RegularExpression &regex,
59                                  VariableList &var_list, size_t &total_matches);
60
61   size_t AppendVariablesWithScope(lldb::ValueType type, VariableList &var_list,
62                                   bool if_unique = true);
63
64   uint32_t FindIndexForVariable(Variable *variable);
65
66   size_t MemorySize() const;
67
68   size_t GetSize() const;
69
70 protected:
71   typedef std::vector<lldb::VariableSP> collection;
72   typedef collection::iterator iterator;
73   typedef collection::const_iterator const_iterator;
74
75   collection m_variables;
76
77 private:
78   //------------------------------------------------------------------
79   // For VariableList only
80   //------------------------------------------------------------------
81   DISALLOW_COPY_AND_ASSIGN(VariableList);
82 };
83
84 } // namespace lldb_private
85
86 #endif // liblldb_VariableList_h_