Skip to content

Commit defe915

Browse files
committed
Update names
1 parent caade22 commit defe915

File tree

6 files changed

+23
-25
lines changed

6 files changed

+23
-25
lines changed

lldb/include/lldb/Target/Target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class TargetProperties : public Properties {
215215

216216
bool GetSwiftAutoImportFrameworks() const;
217217

218-
bool GetSwiftUseNewPrintObject() const;
218+
bool GetSwiftUseContextFreePrintObject() const;
219219

220220
bool GetEnableAutoImportClangModules() const;
221221

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

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ std::string SwiftLanguageRuntime::GetObjectDescriptionExpr_Copy(
913913
}
914914

915915
static llvm::Expected<ValueObjectSP>
916-
runObjectDescription(ValueObject &object, std::string &expr_string,
916+
RunObjectDescription(ValueObject &object, std::string &expr_string,
917917
Process &process, bool disable_availability = false) {
918918
Log *log(GetLog(LLDBLog::DataFormatters | LLDBLog::Expressions));
919919
ValueObjectSP result_sp;
@@ -958,18 +958,7 @@ runObjectDescription(ValueObject &object, std::string &expr_string,
958958
return result_sp;
959959
}
960960

961-
static llvm::Error dumpString(ValueObjectSP result_sp, Stream &strm);
962-
963-
llvm::Error SwiftLanguageRuntime::RunObjectDescriptionExpr(
964-
ValueObject &object, std::string &expr_string, Stream &strm) {
965-
auto result_or_err = runObjectDescription(object, expr_string, GetProcess());
966-
if (!result_or_err)
967-
return result_or_err.takeError();
968-
969-
return dumpString(*result_or_err, strm);
970-
}
971-
972-
static llvm::Error dumpString(ValueObjectSP result_sp, Stream &strm) {
961+
static llvm::Error DumpString(ValueObjectSP result_sp, Stream &strm) {
973962
Log *log(GetLog(LLDBLog::DataFormatters | LLDBLog::Expressions));
974963
formatters::StringPrinter::ReadStringAndDumpToStreamOptions dump_options;
975964
dump_options.SetEscapeNonPrintables(false);
@@ -992,6 +981,15 @@ static llvm::Error dumpString(ValueObjectSP result_sp, Stream &strm) {
992981
return llvm::createStringError("expression produced unprintable string");
993982
}
994983

984+
llvm::Error SwiftLanguageRuntime::RunObjectDescriptionExpr(
985+
ValueObject &object, std::string &expr_string, Stream &strm) {
986+
auto result_or_err = RunObjectDescription(object, expr_string, GetProcess());
987+
if (!result_or_err)
988+
return result_or_err.takeError();
989+
990+
return DumpString(*result_or_err, strm);
991+
}
992+
995993
static bool IsVariable(ValueObject &object) {
996994
if (object.IsSynthetic())
997995
return IsVariable(*object.GetNonSyntheticValue());
@@ -1021,7 +1019,7 @@ static bool IsSwiftReferenceType(ValueObject &object) {
10211019
return false;
10221020
}
10231021

1024-
static bool printObjectViaPointer(Stream &strm, ValueObject &object,
1022+
static bool PrintObjectViaPointer(Stream &strm, ValueObject &object,
10251023
Process &process) {
10261024
Log *log = GetLog(LLDBLog::DataFormatters | LLDBLog::Expressions);
10271025

@@ -1055,7 +1053,7 @@ static bool printObjectViaPointer(Stream &strm, ValueObject &object,
10551053
addr, mangled_type_name)
10561054
.str();
10571055

1058-
auto result_or_err = runObjectDescription(object, expr_string, process, true);
1056+
auto result_or_err = RunObjectDescription(object, expr_string, process, true);
10591057
if (!result_or_err) {
10601058
LLDB_LOG_ERROR(log, result_or_err.takeError(),
10611059
"stringForPrintObject(_:mangledTypeName:) failed: {0}");
@@ -1068,7 +1066,7 @@ static bool printObjectViaPointer(Stream &strm, ValueObject &object,
10681066
auto description_sp = result_sp->GetChildAtIndex(1);
10691067

10701068
StreamString dump_stream;
1071-
auto err = dumpString(description_sp, dump_stream);
1069+
auto err = DumpString(description_sp, dump_stream);
10721070
if (err) {
10731071
LLDB_LOG_ERROR(log, std::move(err),
10741072
"decoding result of "
@@ -1094,8 +1092,8 @@ llvm::Error SwiftLanguageRuntime::GetObjectDescription(Stream &str,
10941092
if (object.IsUninitializedReference())
10951093
return llvm::createStringError("<uninitialized>");
10961094

1097-
if (GetProcess().GetTarget().GetSwiftUseNewPrintObject())
1098-
if (printObjectViaPointer(str, object, GetProcess()))
1095+
if (GetProcess().GetTarget().GetSwiftUseContextFreePrintObject())
1096+
if (PrintObjectViaPointer(str, object, GetProcess()))
10991097
return llvm::Error::success();
11001098

11011099
std::string expr_string;

lldb/source/Target/Target.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4705,14 +4705,14 @@ bool TargetProperties::GetSwiftAutoImportFrameworks() const {
47054705
idx, g_target_properties[idx].default_uint_value != 0);
47064706
}
47074707

4708-
bool TargetProperties::GetSwiftUseNewPrintObject() const {
4708+
bool TargetProperties::GetSwiftUseContextFreePrintObject() const {
47094709
const Property *exp_property =
47104710
m_collection_sp->GetPropertyAtIndex(ePropertyExperimental);
47114711
OptionValueProperties *exp_values =
47124712
exp_property->GetValue()->GetAsProperties();
47134713
if (exp_values)
47144714
return exp_values
4715-
->GetPropertyAtIndexAs<bool>(ePropertySwiftUseNewPrintObject)
4715+
->GetPropertyAtIndexAs<bool>(ePropertySwiftUseContextFreePrintObject)
47164716
.value_or(false);
47174717
return false;
47184718
}

lldb/source/Target/TargetProperties.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ let Definition = "target_experimental" in {
3737
def SwiftCacheTaskPointerLocation: Property<"swift-cache-task-pointer-location", "Boolean">,
3838
DefaultTrue,
3939
Desc<"Enables caching of task pointers inside the swift tasks plugin">;
40-
def SwiftUseNewPrintObject: Property<"swift-use-new-po", "Boolean">,
40+
def SwiftUseContextFreePrintObject: Property<"swift-use-context-free-po", "Boolean">,
4141
DefaultFalse,
42-
Desc<"If true, use the new Swift po implementation.">;
42+
Desc<"If true, use the context-free po implementation for Swift.">;
4343
def UseDIL : Property<"use-DIL", "Boolean">,
4444
Global, DefaultTrue,
4545
Desc<"If true, use the DIL implementation for frame variable evaluation.">;

lldb/test/API/lang/swift/expression/error_reporting/TestSwiftExpressionErrorReporting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_missing_type(self):
6868
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
6969
self, 'break here', lldb.SBFileSpec('main.swift'))
7070

71-
self.runCmd("settings set target.experimental.swift-use-new-po true")
71+
self.runCmd("settings set target.experimental.swift-use-context-free-po true")
7272

7373
options = lldb.SBExpressionOptions()
7474
value = self.frame().EvaluateExpression("strct", options)

lldb/test/API/lang/swift/po/pointer_and_mangled_typename/TestSwiftPrintObjectPointerAndTypeName.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TestCase(TestBase):
99
def setUp(self):
1010
TestBase.setUp(self)
1111
self.build()
12-
self.runCmd("settings set target.experimental.swift-use-new-po true")
12+
self.runCmd("settings set target.experimental.swift-use-context-free-po true")
1313

1414
self.log = self.getBuildArtifact("expr.log")
1515
self.runCmd(f"log enable lldb expr -f {self.log}")

0 commit comments

Comments
 (0)