Skip to content

Commit 77472c7

Browse files
authored
Merge pull request #18 from access-softek/update-lexer
Incorporate DILLexer changes from upstream commit.
2 parents d1ea418 + 7d454a8 commit 77472c7

File tree

14 files changed

+1092
-1214
lines changed

14 files changed

+1092
-1214
lines changed

lldb/include/lldb/ValueObject/DILAST.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
#include "llvm/ADT/APInt.h"
2626
#include "llvm/Support/Casting.h"
2727

28-
namespace lldb_private {
29-
30-
namespace dil {
28+
namespace lldb_private::dil {
3129

3230
/// Struct to hold information about member fields. Used by the parser for the
3331
/// Data Inspection Language (DIL).
@@ -142,7 +140,7 @@ enum class UnaryOpKind {
142140

143141
/// Translates DIL tokens to BinaryOpKind.
144142
BinaryOpKind
145-
dil_token_kind_to_binary_op_kind(dil::TokenKind token_kind);
143+
dil_token_kind_to_binary_op_kind(Token::Kind token_kind);
146144

147145
/// Returns bool indicating whether or not the input kind is an assignment.
148146
bool binary_op_kind_is_comp_assign(BinaryOpKind kind);
@@ -745,8 +743,6 @@ class Visitor {
745743
virtual void Visit(const TernaryOpNode *node) = 0;
746744
};
747745

748-
} // namespace dil
749-
750-
} // namespace lldb_private
746+
} // namespace lldb_private::dil
751747

752748
#endif // LLDB_VALUEOBJECT_DILAST_H

lldb/include/lldb/ValueObject/DILEval.h

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_VALUEOBJECT_DILEVAL_H_
10-
#define LLDB_VALUEOBJECT_DILEVAL_H_
9+
#ifndef LLDB_VALUEOBJECT_DILEVAL_H
10+
#define LLDB_VALUEOBJECT_DILEVAL_H
1111

1212
#include <memory>
1313
#include <vector>
1414

1515
#include "lldb/ValueObject/DILAST.h"
1616
#include "lldb/ValueObject/DILParser.h"
1717

18-
namespace lldb_private {
19-
20-
namespace dil {
18+
namespace lldb_private::dil {
2119

2220
class FlowAnalysis {
2321
public:
@@ -33,13 +31,10 @@ class FlowAnalysis {
3331

3432
class DILInterpreter : Visitor {
3533
public:
36-
DILInterpreter(lldb::TargetSP target,
37-
std::shared_ptr<DILSourceManager> sm);
38-
DILInterpreter(lldb::TargetSP target,
39-
std::shared_ptr<DILSourceManager> sm,
34+
DILInterpreter(lldb::TargetSP target, llvm::StringRef expr);
35+
DILInterpreter(lldb::TargetSP target, llvm::StringRef expr,
4036
lldb::ValueObjectSP scope);
41-
DILInterpreter(lldb::TargetSP target,
42-
std::shared_ptr<DILSourceManager> sm,
37+
DILInterpreter(lldb::TargetSP target, llvm::StringRef expr,
4338
lldb::DynamicValueType use_dynamic);
4439

4540
lldb::ValueObjectSP DILEval(const DILASTNode* tree, lldb::TargetSP target_sp,
@@ -139,7 +134,7 @@ class DILInterpreter : Visitor {
139134
// Used by the interpreter to create objects, perform casts, etc.
140135
lldb::TargetSP m_target;
141136

142-
std::shared_ptr<DILSourceManager> m_sm;
137+
llvm::StringRef m_expr;
143138

144139
// Flow analysis chain represents the expression evaluation flow for the
145140
// current code branch. Each node in the chain corresponds to an AST node,
@@ -162,8 +157,6 @@ class DILInterpreter : Visitor {
162157
Status m_error;
163158
};
164159

165-
} // namespace dil
166-
167-
} // namespace lldb_private
160+
} // namespace lldb_private::dil
168161

169-
#endif // LLDB_VALUEOBJECT_DILEVAL_H_
162+
#endif // LLDB_VALUEOBJECT_DILEVAL_H

0 commit comments

Comments
 (0)