/usr/lib/llvm-3.4/include/lldb/Expression/ClangExpression.h is in liblldb-3.4-dev 1:3.4.2-13.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | //===-- ClangExpression.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_ClangExpression_h_
#define liblldb_ClangExpression_h_
// C Includes
// C++ Includes
#include <string>
#include <map>
#include <vector>
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-forward.h"
#include "lldb/lldb-private.h"
#include "lldb/Core/ClangForward.h"
#include "lldb/Target/Process.h"
namespace lldb_private {
class RecordingMemoryManager;
//----------------------------------------------------------------------
/// @class ClangExpression ClangExpression.h "lldb/Expression/ClangExpression.h"
/// @brief Encapsulates a single expression for use with Clang
///
/// LLDB uses expressions for various purposes, notably to call functions
/// and as a backend for the expr command. ClangExpression encapsulates
/// the objects needed to parse and interpret or JIT an expression. It
/// uses the Clang parser to produce LLVM IR from the expression.
//----------------------------------------------------------------------
class ClangExpression
{
public:
enum ResultType {
eResultTypeAny,
eResultTypeId
};
ClangExpression () :
m_jit_process_wp(),
m_jit_start_addr (LLDB_INVALID_ADDRESS),
m_jit_end_addr (LLDB_INVALID_ADDRESS)
{
}
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
virtual ~ClangExpression ()
{
}
//------------------------------------------------------------------
/// Return the string that the parser should parse. Must be a full
/// translation unit.
//------------------------------------------------------------------
virtual const char *
Text () = 0;
//------------------------------------------------------------------
/// Return the function name that should be used for executing the
/// expression. Text() should contain the definition of this
/// function.
//------------------------------------------------------------------
virtual const char *
FunctionName () = 0;
//------------------------------------------------------------------
/// Return the language that should be used when parsing. To use
/// the default, return eLanguageTypeUnknown.
//------------------------------------------------------------------
virtual lldb::LanguageType
Language ()
{
return lldb::eLanguageTypeUnknown;
}
//------------------------------------------------------------------
/// Return the object that the parser should use when resolving external
/// values. May be NULL if everything should be self-contained.
//------------------------------------------------------------------
virtual ClangExpressionDeclMap *
DeclMap () = 0;
//------------------------------------------------------------------
/// Return the object that the parser should allow to access ASTs.
/// May be NULL if the ASTs do not need to be transformed.
///
/// @param[in] passthrough
/// The ASTConsumer that the returned transformer should send
/// the ASTs to after transformation.
//------------------------------------------------------------------
virtual clang::ASTConsumer *
ASTTransformer (clang::ASTConsumer *passthrough) = 0;
//------------------------------------------------------------------
/// Return the desired result type of the function, or
/// eResultTypeAny if indifferent.
//------------------------------------------------------------------
virtual ResultType
DesiredResultType ()
{
return eResultTypeAny;
}
//------------------------------------------------------------------
/// Flags
//------------------------------------------------------------------
//------------------------------------------------------------------
/// Return true if validation code should be inserted into the
/// expression.
//------------------------------------------------------------------
virtual bool
NeedsValidation () = 0;
//------------------------------------------------------------------
/// Return true if external variables in the expression should be
/// resolved.
//------------------------------------------------------------------
virtual bool
NeedsVariableResolution () = 0;
//------------------------------------------------------------------
/// Return the address of the function's JIT-compiled code, or
/// LLDB_INVALID_ADDRESS if the function is not JIT compiled
//------------------------------------------------------------------
lldb::addr_t
StartAddress ()
{
return m_jit_start_addr;
}
protected:
lldb::ProcessWP m_jit_process_wp;
lldb::addr_t m_jit_start_addr; ///< The address of the JITted function within the JIT allocation. LLDB_INVALID_ADDRESS if invalid.
lldb::addr_t m_jit_end_addr; ///< The address of the JITted function within the JIT allocation. LLDB_INVALID_ADDRESS if invalid.
};
} // namespace lldb_private
#endif // liblldb_ClangExpression_h_
|