diff options
| author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2015-11-07 00:28:50 +0000 |
|---|---|---|
| committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2015-11-07 00:28:50 +0000 |
| commit | 26f34fb6df5f52a6f8dd8b9659509e2f3a99c4cd (patch) | |
| tree | dc076949bc3f8cf7f4ed6e23bce671510d95267d /lldb/source/Plugins/ExpressionParser/Go | |
| parent | ba60247a1127d9eabe233eeeb1496b1c3a5f09c5 (diff) | |
| download | bcm5719-llvm-26f34fb6df5f52a6f8dd8b9659509e2f3a99c4cd.tar.gz bcm5719-llvm-26f34fb6df5f52a6f8dd8b9659509e2f3a99c4cd.zip | |
Fix some Clang-tidy warnings and formatting in recently added code.
Fixed Clang-tidy warnings:
* modernize-use-override;
* modernize-use-nullptr;
* modernize-use-default;
* readability-simplify-boolean-expr.
llvm-svn: 252374
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Go')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp | 32 | ||||
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h | 23 |
2 files changed, 37 insertions, 18 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp index 7cc294eeb2f..3f12a2b6255 100644 --- a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp +++ b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp @@ -1,4 +1,4 @@ -//===-- GoUserExpression.cpp ---------------------------------*- C++ -*-===// +//===-- GoUserExpression.cpp ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,16 +7,23 @@ // //===----------------------------------------------------------------------===// +// C Includes #include <stdio.h> #if HAVE_SYS_TYPES_H #include <sys/types.h> #endif +// C++ Includes #include <cstdlib> +#include <memory> #include <string> -#include <map> #include <vector> +// Other libraries and framework includes +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringMap.h" + +// Project includes #include "GoUserExpression.h" #include "lldb/lldb-private.h" @@ -41,8 +48,6 @@ #include "lldb/Target/Target.h" #include "lldb/Target/ThreadPlan.h" #include "lldb/Target/ThreadPlanCallUserExpression.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/ADT/StringMap.h" #include "Plugins/ExpressionParser/Go/GoAST.h" #include "Plugins/ExpressionParser/Go/GoParser.h" @@ -86,6 +91,7 @@ class GoUserExpression::GoInterpreter m_parser.GetError(m_error); return nullptr; } + ValueObjectSP VisitParenExpr(const GoASTParenExpr *e); ValueObjectSP VisitIdent(const GoASTIdent *e); ValueObjectSP VisitStarExpr(const GoASTStarExpr *e); @@ -94,66 +100,79 @@ class GoUserExpression::GoInterpreter ValueObjectSP VisitIndexExpr(const GoASTIndexExpr *e); ValueObjectSP VisitUnaryExpr(const GoASTUnaryExpr *e); ValueObjectSP VisitCallExpr(const GoASTCallExpr *e); + ValueObjectSP VisitTypeAssertExpr(const GoASTTypeAssertExpr *e) { return NotImplemented(e); } + ValueObjectSP VisitBinaryExpr(const GoASTBinaryExpr *e) { return NotImplemented(e); } + ValueObjectSP VisitArrayType(const GoASTArrayType *e) { return NotImplemented(e); } + ValueObjectSP VisitChanType(const GoASTChanType *e) { return NotImplemented(e); } + ValueObjectSP VisitCompositeLit(const GoASTCompositeLit *e) { return NotImplemented(e); } + ValueObjectSP VisitEllipsis(const GoASTEllipsis *e) { return NotImplemented(e); } + ValueObjectSP VisitFuncType(const GoASTFuncType *e) { return NotImplemented(e); } + ValueObjectSP VisitFuncLit(const GoASTFuncLit *e) { return NotImplemented(e); } + ValueObjectSP VisitInterfaceType(const GoASTInterfaceType *e) { return NotImplemented(e); } + ValueObjectSP VisitKeyValueExpr(const GoASTKeyValueExpr *e) { return NotImplemented(e); } + ValueObjectSP VisitMapType(const GoASTMapType *e) { return NotImplemented(e); } + ValueObjectSP VisitSliceExpr(const GoASTSliceExpr *e) { return NotImplemented(e); } + ValueObjectSP VisitStructType(const GoASTStructType *e) { @@ -217,6 +236,7 @@ LookupType(TargetSP target, ConstString name) } return CompilerType(); } + GoUserExpression::GoUserExpression(ExecutionContextScope &exe_scope, const char *expr, const char *expr_prefix, lldb::LanguageType language, ResultType desired_type, const EvaluateExpressionOptions &options) @@ -531,7 +551,7 @@ GoUserExpression::GoInterpreter::VisitBasicLit(const lldb_private::GoASTBasicLit return nullptr; } errno = 0; - int64_t intvalue = strtol(value.c_str(), NULL, 0); + int64_t intvalue = strtol(value.c_str(), nullptr, 0); if (errno != 0) { m_error.SetErrorToErrno(); @@ -731,6 +751,6 @@ GoPersistentExpressionState::RemovePersistentVariable(lldb::ExpressionVariableSP if (*(name++) != 'o') return; - if (strtoul(name, NULL, 0) == m_next_persistent_variable_id - 1) + if (strtoul(name, nullptr, 0) == m_next_persistent_variable_id - 1) m_next_persistent_variable_id--; } diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h index 5cee22deb80..b429c68f023 100644 --- a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h +++ b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h @@ -1,4 +1,4 @@ -//===-- GoUserExpression.h -----------------------------------*- C++ -*-===// +//===-- GoUserExpression.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,13 +12,10 @@ // C Includes // C++ Includes -#include <string> -#include <map> -#include <vector> +#include <memory> // Other libraries and framework includes // Project includes - #include "lldb/lldb-forward.h" #include "lldb/lldb-private.h" #include "lldb/Expression/UserExpression.h" @@ -68,13 +65,15 @@ class GoUserExpression : public UserExpression GoUserExpression(ExecutionContextScope &exe_scope, const char *expr, const char *expr_prefix, lldb::LanguageType language, ResultType desired_type, const EvaluateExpressionOptions &options); - virtual bool Parse(Stream &error_stream, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, - bool keep_result_in_memory, bool generate_debug_info) override; - - virtual lldb::ExpressionResults Execute(Stream &error_stream, ExecutionContext &exe_ctx, - const EvaluateExpressionOptions &options, - lldb::UserExpressionSP &shared_ptr_to_me, - lldb::ExpressionVariableSP &result) override; + bool + Parse(Stream &error_stream, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, + bool keep_result_in_memory, bool generate_debug_info) override; + + lldb::ExpressionResults + Execute(Stream &error_stream, ExecutionContext &exe_ctx, + const EvaluateExpressionOptions &options, + lldb::UserExpressionSP &shared_ptr_to_me, + lldb::ExpressionVariableSP &result) override; bool CanInterpret() override |

