diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip |
*** 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.
llvm-svn: 280751
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h')
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h | 152 |
1 files changed, 65 insertions, 87 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h index d4ed37eee04..80577199b81 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h @@ -12,24 +12,24 @@ // C Includes // C++ Includes -#include <string> #include <map> +#include <string> #include <vector> // Other libraries and framework includes // Project includes #include "ClangExpressionHelper.h" -#include "lldb/lldb-forward.h" -#include "lldb/lldb-private.h" #include "lldb/Core/ClangForward.h" #include "lldb/Expression/UtilityFunction.h" +#include "lldb/lldb-forward.h" +#include "lldb/lldb-private.h" -namespace lldb_private -{ +namespace lldb_private { //---------------------------------------------------------------------- -/// @class ClangUtilityFunction ClangUtilityFunction.h "lldb/Expression/ClangUtilityFunction.h" +/// @class ClangUtilityFunction ClangUtilityFunction.h +/// "lldb/Expression/ClangUtilityFunction.h" /// @brief Encapsulates a single expression for use with Clang /// /// LLDB uses expressions for various purposes, notably to call functions @@ -39,97 +39,75 @@ namespace lldb_private /// simply provide a way to push a function into the target for the debugger to /// call later on. //---------------------------------------------------------------------- -class ClangUtilityFunction : public UtilityFunction -{ +class ClangUtilityFunction : public UtilityFunction { public: - class ClangUtilityFunctionHelper : public ClangExpressionHelper - { - public: - ClangUtilityFunctionHelper () - { - } - - ~ClangUtilityFunctionHelper() override {} - - //------------------------------------------------------------------ - /// Return the object that the parser should use when resolving external - /// values. May be NULL if everything should be self-contained. - //------------------------------------------------------------------ - ClangExpressionDeclMap * - DeclMap() override - { - return m_expr_decl_map_up.get(); - } - - void - ResetDeclMap() - { - m_expr_decl_map_up.reset(); - } - - void - ResetDeclMap (ExecutionContext & exe_ctx, bool keep_result_in_memory); - - //------------------------------------------------------------------ - /// 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. - //------------------------------------------------------------------ - clang::ASTConsumer * - ASTTransformer(clang::ASTConsumer *passthrough) override - { - return nullptr; - } - private: - std::unique_ptr<ClangExpressionDeclMap> m_expr_decl_map_up; - }; + class ClangUtilityFunctionHelper : public ClangExpressionHelper { + public: + ClangUtilityFunctionHelper() {} + + ~ClangUtilityFunctionHelper() override {} + //------------------------------------------------------------------ - /// Constructor - /// - /// @param[in] text - /// The text of the function. Must be a full translation unit. - /// - /// @param[in] name - /// The name of the function, as used in the text. + /// Return the object that the parser should use when resolving external + /// values. May be NULL if everything should be self-contained. //------------------------------------------------------------------ - ClangUtilityFunction (ExecutionContextScope &exe_scope, - const char *text, - const char *name); - - ~ClangUtilityFunction() override; - - ExpressionTypeSystemHelper * - GetTypeSystemHelper () override - { - return &m_type_system_helper; + ClangExpressionDeclMap *DeclMap() override { + return m_expr_decl_map_up.get(); } - ClangExpressionDeclMap * - DeclMap() - { - return m_type_system_helper.DeclMap(); - } + void ResetDeclMap() { m_expr_decl_map_up.reset(); } - void - ResetDeclMap () - { - m_type_system_helper.ResetDeclMap(); - } - - void - ResetDeclMap (ExecutionContext & exe_ctx, bool keep_result_in_memory) - { - m_type_system_helper.ResetDeclMap(exe_ctx, keep_result_in_memory); + void ResetDeclMap(ExecutionContext &exe_ctx, bool keep_result_in_memory); + + //------------------------------------------------------------------ + /// 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. + //------------------------------------------------------------------ + clang::ASTConsumer * + ASTTransformer(clang::ASTConsumer *passthrough) override { + return nullptr; } - bool - Install(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx) override; + private: + std::unique_ptr<ClangExpressionDeclMap> m_expr_decl_map_up; + }; + //------------------------------------------------------------------ + /// Constructor + /// + /// @param[in] text + /// The text of the function. Must be a full translation unit. + /// + /// @param[in] name + /// The name of the function, as used in the text. + //------------------------------------------------------------------ + ClangUtilityFunction(ExecutionContextScope &exe_scope, const char *text, + const char *name); + + ~ClangUtilityFunction() override; + + ExpressionTypeSystemHelper *GetTypeSystemHelper() override { + return &m_type_system_helper; + } + + ClangExpressionDeclMap *DeclMap() { return m_type_system_helper.DeclMap(); } + + void ResetDeclMap() { m_type_system_helper.ResetDeclMap(); } + + void ResetDeclMap(ExecutionContext &exe_ctx, bool keep_result_in_memory) { + m_type_system_helper.ResetDeclMap(exe_ctx, keep_result_in_memory); + } + + bool Install(DiagnosticManager &diagnostic_manager, + ExecutionContext &exe_ctx) override; private: - ClangUtilityFunctionHelper m_type_system_helper; ///< The map to use when parsing and materializing the expression. + ClangUtilityFunctionHelper m_type_system_helper; ///< The map to use when + ///parsing and materializing + ///the expression. }; } // namespace lldb_private |