summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp32
1 files changed, 26 insertions, 6 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--;
}
OpenPOWER on IntegriCloud