Skip to content

Commit b672137

Browse files
committed
[lldb] Update call to AbstractFunctionDecl::setBody
1 parent 33ce834 commit b672137

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,10 +1202,12 @@ bool SwiftASTManipulator::AddExternalVariables(
12021202
wrapper_element_iterator = wrapper_elements_copy.insert(
12031203
wrapper_element_iterator, swift::ASTNode(redirected_var_decl));
12041204

1205-
m_wrapper_decl->setBody(swift::BraceStmt::create(
1205+
auto *new_wrapper_body = swift::BraceStmt::create(
12061206
ast_context, wrapper_body->getLBraceLoc(),
12071207
ast_context.AllocateCopy(wrapper_elements_copy),
1208-
wrapper_body->getRBraceLoc()));
1208+
wrapper_body->getRBraceLoc());
1209+
m_wrapper_decl->setBody(new_wrapper_body,
1210+
m_wrapper_decl->getBodyKind());
12091211
} else {
12101212
element_iterator =
12111213
elements.insert(element_iterator, swift::ASTNode(pattern_binding));
@@ -1229,9 +1231,10 @@ bool SwiftASTManipulator::AddExternalVariables(
12291231
m_variables.push_back(variable);
12301232
}
12311233

1232-
m_function_decl->setBody(swift::BraceStmt::create(
1234+
auto *new_function_body = swift::BraceStmt::create(
12331235
ast_context, body->getLBraceLoc(), ast_context.AllocateCopy(elements),
1234-
body->getRBraceLoc()));
1236+
body->getRBraceLoc());
1237+
m_function_decl->setBody(new_function_body, m_function_decl->getBodyKind());
12351238
}
12361239

12371240
return true;

0 commit comments

Comments
 (0)