Skip to content

Commit 8618667

Browse files
committed
[lldb] Update call to AbstractFunctionDecl::setBody
1 parent d830a31 commit 8618667

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
@@ -1219,10 +1219,12 @@ bool SwiftASTManipulator::AddExternalVariables(
12191219
wrapper_element_iterator = wrapper_elements_copy.insert(
12201220
wrapper_element_iterator, swift::ASTNode(redirected_var_decl));
12211221

1222-
m_wrapper_decl->setBody(swift::BraceStmt::create(
1222+
auto *new_wrapper_body = swift::BraceStmt::create(
12231223
ast_context, wrapper_body->getLBraceLoc(),
12241224
ast_context.AllocateCopy(wrapper_elements_copy),
1225-
wrapper_body->getRBraceLoc()));
1225+
wrapper_body->getRBraceLoc());
1226+
m_wrapper_decl->setBody(new_wrapper_body,
1227+
m_wrapper_decl->getBodyKind());
12261228
} else {
12271229
element_iterator =
12281230
elements.insert(element_iterator, swift::ASTNode(pattern_binding));
@@ -1246,9 +1248,10 @@ bool SwiftASTManipulator::AddExternalVariables(
12461248
m_variables.push_back(variable);
12471249
}
12481250

1249-
m_function_decl->setBody(swift::BraceStmt::create(
1251+
auto *new_function_body = swift::BraceStmt::create(
12501252
ast_context, body->getLBraceLoc(), ast_context.AllocateCopy(elements),
1251-
body->getRBraceLoc()));
1253+
body->getRBraceLoc());
1254+
m_function_decl->setBody(new_function_body, m_function_decl->getBodyKind());
12521255
}
12531256

12541257
return true;

0 commit comments

Comments
 (0)