Skip to content

[lldb][swift] Add ifdefs for swift customization #9423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lldb/source/Expression/DWARFExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ bool DWARFExpression::LinkThreadLocalStorage(
return true;
}

#ifdef LLDB_ENABLE_SWIFT
/// Returns true if \c opcodes contains the opcode for the register used for the
/// Swift Async Context (x22 for aarch64, r14 for x86-64). It must also not
/// contain any other opcodes.
Expand Down Expand Up @@ -600,6 +601,7 @@ static llvm::Expected<Value> SwiftAsyncEvaluate_DW_OP_entry_value(
current_offset = new_offset;
return maybe_result;
}
#endif // LLDB_ENABLE_SWIFT

static llvm::Error
Evaluate_DW_OP_entry_value(std::vector<Value> &stack, const DWARFUnit *dwarf_cu,
Expand Down Expand Up @@ -698,13 +700,15 @@ Evaluate_DW_OP_entry_value(std::vector<Value> &stack, const DWARFUnit *dwarf_cu,
if (!current_func)
return llvm::createStringError("no current function");

#ifdef LLDB_ENABLE_SWIFT
if (llvm::Expected<Value> result = SwiftAsyncEvaluate_DW_OP_entry_value(
*exe_ctx, *current_frame, dwarf_cu, *current_func, opcodes,
opcode_offset)) {
stack.push_back(*result);
return llvm::Error::success();
} else
LLDB_LOG_ERROR(log, result.takeError(), "{0}");
#endif // LLDB_ENABLE_SWIFT

CallEdge *call_edge = nullptr;
ModuleList &modlist = target.GetImages();
Expand Down