@@ -913,7 +913,7 @@ std::string SwiftLanguageRuntime::GetObjectDescriptionExpr_Copy(
913913}
914914
915915static 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+
995993static 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;
0 commit comments