Skip to content

Commit 9442b97

Browse files
committed
Rename new eval option to its abstraction not its implementation
1 parent 5cb63c4 commit 9442b97

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

lldb/include/lldb/Target/Target.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,11 +568,13 @@ class EvaluateExpressionOptions {
568568

569569
bool GetPreparePlaygroundStubFunctions() const { return m_prepare_playground_stub_functions; }
570570

571-
void SetDisableAvailability(bool disable = true) {
572-
m_disable_availability = disable;
571+
void SetUseContextFreeSwiftPrintObject(bool enable = true) {
572+
m_use_context_free_swift_print_object = enable;
573573
}
574574

575-
bool GetDisableAvailability() const { return m_disable_availability; }
575+
bool GetUseContextFreeSwiftPrintObject() const {
576+
return m_use_context_free_swift_print_object;
577+
}
576578

577579
private:
578580
ExecutionPolicy m_execution_policy = default_execution_policy;
@@ -615,8 +617,10 @@ class EvaluateExpressionOptions {
615617
mutable uint32_t m_pound_line_line = 0;
616618
bool m_prepare_playground_stub_functions = true;
617619

618-
/// Disable compiler availability checking.
619-
bool m_disable_availability = false;
620+
/// An evaluation mode that for swift. Has the following effects:
621+
/// 1. Disables implicit module loading
622+
/// 2. Disables compiler availability checking
623+
bool m_use_context_free_swift_print_object = false;
620624

621625
/// During expression evaluation, any SymbolContext in this list will be
622626
/// used for symbol/function lookup before any other context (except for

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ Status SwiftExpressionSourceCode::GetText(
640640
if (triple.isOSDarwin()) {
641641
if (auto process_sp = exe_ctx.GetProcessSP()) {
642642
os_vers << getAvailabilityName(triple) << " ";
643-
if (options.GetDisableAvailability()) {
643+
if (options.GetUseContextFreeSwiftPrintObject()) {
644644
// Disable availability by setting the OS version to 9999. This
645645
// placeholder OS version used for future OS versions when building
646646
// the Swift standard library locally.

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ std::string SwiftLanguageRuntime::GetObjectDescriptionExpr_Copy(
914914

915915
static llvm::Expected<ValueObjectSP>
916916
RunObjectDescription(ValueObject &object, std::string &expr_string,
917-
Process &process, bool disable_availability = false) {
917+
Process &process, bool context_free = false) {
918918
Log *log(GetLog(LLDBLog::DataFormatters | LLDBLog::Expressions));
919919
ValueObjectSP result_sp;
920920
EvaluateExpressionOptions eval_options;
@@ -923,8 +923,8 @@ RunObjectDescription(ValueObject &object, std::string &expr_string,
923923
eval_options.SetSuppressPersistentResult(true);
924924
eval_options.SetIgnoreBreakpoints(true);
925925
eval_options.SetTimeout(process.GetUtilityExpressionTimeout());
926-
if (disable_availability)
927-
eval_options.SetDisableAvailability();
926+
if (context_free)
927+
eval_options.SetUseContextFreeSwiftPrintObject();
928928

929929
StackFrameSP frame_sp = object.GetFrameSP();
930930
if (!frame_sp)

0 commit comments

Comments
 (0)