summaryrefslogtreecommitdiff
path: root/include/lldb/Expression/ExpressionParser.h
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commita015ff55b22de49a8805ab5c368e5eca6a20d748 (patch)
treebe2c8a4e39125a86a0abc1849ffb86ef3e3215df /include/lldb/Expression/ExpressionParser.h
parent063858bb04fcfbd1272d85dc8f25b913975b0c95 (diff)
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@280751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/lldb/Expression/ExpressionParser.h')
-rw-r--r--include/lldb/Expression/ExpressionParser.h211
1 files changed, 98 insertions, 113 deletions
diff --git a/include/lldb/Expression/ExpressionParser.h b/include/lldb/Expression/ExpressionParser.h
index 323e515e3..99f583d7c 100644
--- a/include/lldb/Expression/ExpressionParser.h
+++ b/include/lldb/Expression/ExpressionParser.h
@@ -10,131 +10,116 @@
#ifndef liblldb_ExpressionParser_h_
#define liblldb_ExpressionParser_h_
-#include "lldb/lldb-public.h"
#include "lldb/Core/Error.h"
+#include "lldb/lldb-public.h"
-namespace lldb_private
-{
+namespace lldb_private {
class IRExecutionUnit;
-
+
//----------------------------------------------------------------------
-/// @class ExpressionParser ExpressionParser.h "lldb/Expression/ExpressionParser.h"
+/// @class ExpressionParser ExpressionParser.h
+/// "lldb/Expression/ExpressionParser.h"
/// @brief Encapsulates an instance of a compiler that can parse expressions.
///
/// ExpressionParser is the base class for llvm based Expression parsers.
//----------------------------------------------------------------------
-class ExpressionParser
-{
+class ExpressionParser {
public:
- //------------------------------------------------------------------
- /// Constructor
- ///
- /// Initializes class variables.
- ///
- /// @param[in] exe_scope,
- /// If non-NULL, an execution context scope that can help to
- /// correctly create an expression with a valid process for
- /// optional tuning Objective-C runtime support. Can be NULL.
- ///
- /// @param[in] expr
- /// The expression to be parsed.
- //------------------------------------------------------------------
- ExpressionParser (ExecutionContextScope *exe_scope,
- Expression &expr,
- bool generate_debug_info) :
- m_expr(expr),
- m_generate_debug_info(generate_debug_info)
- {
- }
-
- //------------------------------------------------------------------
- /// Destructor
- //------------------------------------------------------------------
- virtual ~ExpressionParser () {};
-
- //------------------------------------------------------------------
- /// Parse a single expression and convert it to IR using Clang. Don't
- /// wrap the expression in anything at all.
- ///
- /// @param[in] diagnostic_manager
- /// The diagnostic manager in which to store the errors and warnings.
- ///
- /// @return
- /// The number of errors encountered during parsing. 0 means
- /// success.
- //------------------------------------------------------------------
- virtual unsigned
- Parse(DiagnosticManager &diagnostic_manager) = 0;
-
- //------------------------------------------------------------------
- /// Try to use the FixIts in the diagnostic_manager to rewrite the
- /// expression. If successful, the rewritten expression is stored
- /// in the diagnostic_manager, get it out with GetFixedExpression.
- ///
- /// @param[in] diagnostic_manager
- /// The diagnostic manager containing fixit's to apply.
- ///
- /// @return
- /// \b true if the rewrite was successful, \b false otherwise.
- //------------------------------------------------------------------
- virtual bool
- RewriteExpression(DiagnosticManager &diagnostic_manager)
- {
- return false;
- }
+ //------------------------------------------------------------------
+ /// Constructor
+ ///
+ /// Initializes class variables.
+ ///
+ /// @param[in] exe_scope,
+ /// If non-NULL, an execution context scope that can help to
+ /// correctly create an expression with a valid process for
+ /// optional tuning Objective-C runtime support. Can be NULL.
+ ///
+ /// @param[in] expr
+ /// The expression to be parsed.
+ //------------------------------------------------------------------
+ ExpressionParser(ExecutionContextScope *exe_scope, Expression &expr,
+ bool generate_debug_info)
+ : m_expr(expr), m_generate_debug_info(generate_debug_info) {}
+
+ //------------------------------------------------------------------
+ /// Destructor
+ //------------------------------------------------------------------
+ virtual ~ExpressionParser(){};
+
+ //------------------------------------------------------------------
+ /// Parse a single expression and convert it to IR using Clang. Don't
+ /// wrap the expression in anything at all.
+ ///
+ /// @param[in] diagnostic_manager
+ /// The diagnostic manager in which to store the errors and warnings.
+ ///
+ /// @return
+ /// The number of errors encountered during parsing. 0 means
+ /// success.
+ //------------------------------------------------------------------
+ virtual unsigned Parse(DiagnosticManager &diagnostic_manager) = 0;
+
+ //------------------------------------------------------------------
+ /// Try to use the FixIts in the diagnostic_manager to rewrite the
+ /// expression. If successful, the rewritten expression is stored
+ /// in the diagnostic_manager, get it out with GetFixedExpression.
+ ///
+ /// @param[in] diagnostic_manager
+ /// The diagnostic manager containing fixit's to apply.
+ ///
+ /// @return
+ /// \b true if the rewrite was successful, \b false otherwise.
+ //------------------------------------------------------------------
+ virtual bool RewriteExpression(DiagnosticManager &diagnostic_manager) {
+ return false;
+ }
+
+ //------------------------------------------------------------------
+ /// Ready an already-parsed expression for execution, possibly
+ /// evaluating it statically.
+ ///
+ /// @param[out] func_addr
+ /// The address to which the function has been written.
+ ///
+ /// @param[out] func_end
+ /// The end of the function's allocated memory region. (func_addr
+ /// and func_end do not delimit an allocated region; the allocated
+ /// region may begin before func_addr.)
+ ///
+ /// @param[in] execution_unit_sp
+ /// After parsing, ownership of the execution unit for
+ /// for the expression is handed to this shared pointer.
+ ///
+ /// @param[in] exe_ctx
+ /// The execution context to write the function into.
+ ///
+ /// @param[out] can_interpret
+ /// Set to true if the expression could be interpreted statically;
+ /// untouched otherwise.
+ ///
+ /// @param[in] execution_policy
+ /// Determines whether the expression must be JIT-compiled, must be
+ /// evaluated statically, or whether this decision may be made
+ /// opportunistically.
+ ///
+ /// @return
+ /// An error code indicating the success or failure of the operation.
+ /// Test with Success().
+ //------------------------------------------------------------------
+ virtual Error
+ PrepareForExecution(lldb::addr_t &func_addr, lldb::addr_t &func_end,
+ std::shared_ptr<IRExecutionUnit> &execution_unit_sp,
+ ExecutionContext &exe_ctx, bool &can_interpret,
+ lldb_private::ExecutionPolicy execution_policy) = 0;
+
+ bool GetGenerateDebugInfo() const { return m_generate_debug_info; }
- //------------------------------------------------------------------
- /// Ready an already-parsed expression for execution, possibly
- /// evaluating it statically.
- ///
- /// @param[out] func_addr
- /// The address to which the function has been written.
- ///
- /// @param[out] func_end
- /// The end of the function's allocated memory region. (func_addr
- /// and func_end do not delimit an allocated region; the allocated
- /// region may begin before func_addr.)
- ///
- /// @param[in] execution_unit_sp
- /// After parsing, ownership of the execution unit for
- /// for the expression is handed to this shared pointer.
- ///
- /// @param[in] exe_ctx
- /// The execution context to write the function into.
- ///
- /// @param[out] can_interpret
- /// Set to true if the expression could be interpreted statically;
- /// untouched otherwise.
- ///
- /// @param[in] execution_policy
- /// Determines whether the expression must be JIT-compiled, must be
- /// evaluated statically, or whether this decision may be made
- /// opportunistically.
- ///
- /// @return
- /// An error code indicating the success or failure of the operation.
- /// Test with Success().
- //------------------------------------------------------------------
- virtual Error
- PrepareForExecution (lldb::addr_t &func_addr,
- lldb::addr_t &func_end,
- std::shared_ptr<IRExecutionUnit> &execution_unit_sp,
- ExecutionContext &exe_ctx,
- bool &can_interpret,
- lldb_private::ExecutionPolicy execution_policy) = 0;
-
- bool
- GetGenerateDebugInfo () const
- {
- return m_generate_debug_info;
- }
-
protected:
- Expression & m_expr; ///< The expression to be parsed
- bool m_generate_debug_info;
+ Expression &m_expr; ///< The expression to be parsed
+ bool m_generate_debug_info;
};
-
}
-#endif // liblldb_ExpressionParser_h_
+#endif // liblldb_ExpressionParser_h_