Files
clang-p2996/lldb/include/lldb/Expression/ClangPersistentVariables.h
Sean Callanan 5b26f27f46 I have brought LLDB up-to-date with top of tree
LLVM/Clang.  This brings in several fixes, including:

- Improvements in the Just-In-Time compiler's
  allocation of memory: the JIT now allocates
  memory in chunks of sections, improving its
  ability to generate relocations.  I have
  revamped the RecordingMemoryManager to reflect
  these changes, as well as to get the memory
  allocation and data copying out fo the
  ClangExpressionParser code.  Jim Grosbach wrote
  the updates to the JIT on the LLVM side.

- A new ExternalASTSource interface to allow LLDB to
  report accurate structure layout information to
  Clang.  Previously we could only report the sizes
  of fields, not their offsets.  This meant that if
  data structures included field alignment
  directives, we could not communicate the necessary
  alignment to Clang and accesses to the data would
  fail.  Now we can (and I have update the relevant
  test case).  Thanks to Doug Gregor for implementing
  the Clang side of this fix.

- The way Objective-C interfaces are completed by
  Clang has been made consistent with RecordDecls;
  with help from Doug Gregor and Greg Clayton I have
  ensured that this still works.

- I have eliminated all local LLVM and Clang patches,
  committing the ones that are still relevant to LLVM
  and Clang as needed.

I have tested the changes extensively locally, but
please let me know if they cause any trouble for you.

llvm-svn: 149775
2012-02-04 08:49:35 +00:00

76 lines
2.9 KiB
C++

//===-- 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 "lldb/Expression/ClangExpressionVariable.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 ClangExpressionVariableList
{
public:
//----------------------------------------------------------------------
/// Constructor
//----------------------------------------------------------------------
ClangPersistentVariables ();
lldb::ClangExpressionVariableSP
CreatePersistentVariable (const lldb::ValueObjectSP &valobj_sp);
lldb::ClangExpressionVariableSP
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::ClangExpressionVariableSP variable);
void
RegisterPersistentType (const ConstString &name,
clang::TypeDecl *tag_decl);
clang::TypeDecl *
GetPersistentType (const ConstString &name);
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.
};
}
#endif