1 //===-- ClangPersistentVariables.h ------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ClangPersistentVariables_h_
11 #define liblldb_ClangPersistentVariables_h_
13 #include "lldb/Expression/ClangExpressionVariable.h"
14 #include "llvm/ADT/DenseMap.h"
16 namespace lldb_private
19 //----------------------------------------------------------------------
20 /// @class ClangPersistentVariables ClangPersistentVariables.h "lldb/Expression/ClangPersistentVariables.h"
21 /// @brief Manages persistent values that need to be preserved between expression invocations.
23 /// A list of variables that can be accessed and updated by any expression. See
24 /// ClangPersistentVariable for more discussion. Also provides an increasing,
25 /// 0-based counter for naming result variables.
26 //----------------------------------------------------------------------
27 class ClangPersistentVariables : public ClangExpressionVariableList
31 //----------------------------------------------------------------------
33 //----------------------------------------------------------------------
34 ClangPersistentVariables ();
36 lldb::ClangExpressionVariableSP
37 CreatePersistentVariable (const lldb::ValueObjectSP &valobj_sp);
39 lldb::ClangExpressionVariableSP
40 CreatePersistentVariable (ExecutionContextScope *exe_scope,
41 const ConstString &name,
42 const TypeFromUser& user_type,
43 lldb::ByteOrder byte_order,
44 uint32_t addr_byte_size);
46 //----------------------------------------------------------------------
47 /// Return the next entry in the sequence of strings "$0", "$1", ... for
48 /// use naming persistent expression convenience variables.
51 /// A string that contains the next persistent variable name.
52 //----------------------------------------------------------------------
54 GetNextPersistentVariableName ();
57 RemovePersistentVariable (lldb::ClangExpressionVariableSP variable);
60 RegisterPersistentType (const ConstString &name,
61 clang::TypeDecl *tag_decl);
64 GetPersistentType (const ConstString &name);
67 uint32_t m_next_persistent_variable_id; ///< The counter used by GetNextResultName().
69 typedef llvm::DenseMap<const char *, clang::TypeDecl *> PersistentTypeMap;
70 PersistentTypeMap m_persistent_types; ///< The persistent types declared by the user.