Skip to content

Commit e667d5d

Browse files
committed
[upstreaming] Revert downstream changes to {Clang}ExpressionParser and update SwiftExpressionParser
D69710 landed which allows us to implement the SwiftExpressionParser without changing the ClangExpressionParser
1 parent 6f76810 commit e667d5d

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,7 @@ bool ClangExpressionParser::Complete(CompletionRequest &request, unsigned line,
871871
return true;
872872
}
873873

874-
// Swift only
875-
// Extra arguments are only used in Swift. We should get rid of them
876-
// to avoid clashes when merging from upstream.
877-
// End Swift only
878-
unsigned ClangExpressionParser::Parse(DiagnosticManager &diagnostic_manager,
879-
uint32_t first_line, uint32_t last_line) {
874+
unsigned ClangExpressionParser::Parse(DiagnosticManager &diagnostic_manager) {
880875
return ParseInternal(diagnostic_manager);
881876
}
882877

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class SwiftExpressionParser : public ExpressionParser {
8383
/// success.
8484
//------------------------------------------------------------------
8585
unsigned Parse(DiagnosticManager &diagnostic_manager, uint32_t first_line = 0,
86-
uint32_t last_line = UINT32_MAX) override;
86+
uint32_t last_line = UINT32_MAX);
8787

8888
//------------------------------------------------------------------
8989
/// Ready an already-parsed expression for execution, possibly

lldb/source/Plugins/ExpressionParser/Swift/SwiftUserExpression.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,11 @@ bool SwiftUserExpression::Parse(DiagnosticManager &diagnostic_manager,
377377
exe_scope = exe_ctx.GetTargetPtr();
378378
} while (0);
379379

380-
m_parser =
381-
std::make_unique<SwiftExpressionParser>(exe_scope, *this, m_options);
382-
383-
unsigned error_code = m_parser->Parse(
380+
auto *swift_parser = new SwiftExpressionParser(exe_scope, *this, m_options);
381+
unsigned error_code = swift_parser->Parse(
384382
diagnostic_manager, first_body_line,
385383
first_body_line + source_code->GetNumBodyLines());
384+
m_parser.reset(swift_parser);
386385

387386
if (error_code == 2) {
388387
m_fixed_text = m_expr_text;

0 commit comments

Comments
 (0)