diff options
| author | Sean Callanan <scallanan@apple.com> | 2015-09-25 20:35:58 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2015-09-25 20:35:58 +0000 |
| commit | 4dbb271fcc32cb7e1a336362308dccb08583cec3 (patch) | |
| tree | 2a5bade5dfff082b22987b164e7768748c72e367 /lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h | |
| parent | 10aa8078566379592f36487fe9aa9e6b489d55cc (diff) | |
| download | bcm5719-llvm-4dbb271fcc32cb7e1a336362308dccb08583cec3.tar.gz bcm5719-llvm-4dbb271fcc32cb7e1a336362308dccb08583cec3.zip | |
Moved more Clang-specific parts of the expression parser into the Clang plugin.
There are still a bunch of dependencies on the plug-in, but this helps to
identify them.
There are also a few more bits we need to move (and abstract, for example the
ClangPersistentVariables).
llvm-svn: 248612
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h new file mode 100644 index 00000000000..828badb9564 --- /dev/null +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h @@ -0,0 +1,91 @@ +//===-- ClangPersistentVariables.h ------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_ClangPersistentVariables_h_ +#define liblldb_ClangPersistentVariables_h_ + +#include "ClangExpressionVariable.h" +#include "ClangModulesDeclVendor.h" + +#include "llvm/ADT/DenseMap.h" + +namespace lldb_private +{ + +//---------------------------------------------------------------------- +/// @class ClangPersistentVariables ClangPersistentVariables.h "lldb/Expression/ClangPersistentVariables.h" +/// @brief Manages persistent values that need to be preserved between expression invocations. +/// +/// A list of variables that can be accessed and updated by any expression. See +/// ClangPersistentVariable for more discussion. Also provides an increasing, +/// 0-based counter for naming result variables. +//---------------------------------------------------------------------- +class ClangPersistentVariables : public ExpressionVariableList +{ +public: + + //---------------------------------------------------------------------- + /// Constructor + //---------------------------------------------------------------------- + ClangPersistentVariables (); + + lldb::ExpressionVariableSP + CreatePersistentVariable (const lldb::ValueObjectSP &valobj_sp); + + ClangExpressionVariable * + CreatePersistentVariable (ExecutionContextScope *exe_scope, + const ConstString &name, + const TypeFromUser& user_type, + lldb::ByteOrder byte_order, + uint32_t addr_byte_size); + + //---------------------------------------------------------------------- + /// Return the next entry in the sequence of strings "$0", "$1", ... for + /// use naming persistent expression convenience variables. + /// + /// @return + /// A string that contains the next persistent variable name. + //---------------------------------------------------------------------- + ConstString + GetNextPersistentVariableName (); + + void + RemovePersistentVariable (lldb::ExpressionVariableSP variable); + + void + RegisterPersistentType (const ConstString &name, + clang::TypeDecl *tag_decl); + + clang::TypeDecl * + GetPersistentType (const ConstString &name); + + void + AddHandLoadedClangModule(ClangModulesDeclVendor::ModuleID module) + { + m_hand_loaded_clang_modules.push_back(module); + } + + const ClangModulesDeclVendor::ModuleVector &GetHandLoadedClangModules() + { + return m_hand_loaded_clang_modules; + } + +private: + uint32_t m_next_persistent_variable_id; ///< The counter used by GetNextResultName(). + + typedef llvm::DenseMap<const char *, clang::TypeDecl *> PersistentTypeMap; + PersistentTypeMap m_persistent_types; ///< The persistent types declared by the user. + + ClangModulesDeclVendor::ModuleVector m_hand_loaded_clang_modules; ///< These are Clang modules we hand-loaded; these are the highest- + ///< priority source for macros. +}; + +} + +#endif |

