[Lldb-commits] [lldb] r172755 - /lldb/trunk/source/Interpreter/OptionGroupVariable.cpp

Enrico Granata egranata at apple.com
Thu Jan 17 12:24:11 PST 2013


Author: enrico
Date: Thu Jan 17 14:24:11 2013
New Revision: 172755

URL: http://llvm.org/viewvc/llvm-project?rev=172755&view=rev
Log:
Converting lambdas to plain old static function pointers


Modified:
    lldb/trunk/source/Interpreter/OptionGroupVariable.cpp

Modified: lldb/trunk/source/Interpreter/OptionGroupVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupVariable.cpp?rev=172755&r1=172754&r2=172755&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionGroupVariable.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionGroupVariable.cpp Thu Jan 17 14:24:11 2013
@@ -38,25 +38,30 @@
     { LLDB_OPT_SET_2,                  false, "summary-string",  'z', required_argument, NULL, 0, eArgTypeName, "Specify a summary string to use to format the variable output."},
 };
 
+static Error
+ValidateNamedSummary (const char* str, void*)
+{
+    if (!str || !str[0])
+        return Error("must specify a valid named summary");
+    TypeSummaryImplSP summary_sp;
+    if (DataVisualization::NamedSummaryFormats::GetSummaryFormat(ConstString(str), summary_sp) == false)
+        return Error("must specify a valid named summary");
+    return Error();
+}
+
+static Error
+ValidateSummaryString (const char* str, void*)
+{
+    if (!str || !str[0])
+        return Error("must specify a non-empty summary string");
+    return Error();
+}
 
 OptionGroupVariable::OptionGroupVariable (bool show_frame_options) :
     OptionGroup(),
     include_frame_options (show_frame_options),
-    summary([] (const char* str,void*)->Error
-            {
-                if (!str || !str[0])
-                    return Error("must specify a valid named summary");
-                TypeSummaryImplSP summary_sp;
-                if (DataVisualization::NamedSummaryFormats::GetSummaryFormat(ConstString(str), summary_sp) == false)
-                    return Error("must specify a valid named summary");
-                return Error();
-            }),
-    summary_string([] (const char* str, void*)->Error
-           {
-               if (!str || !str[0])
-                   return Error("must specify a non-empty summary string");
-               return Error();
-           })
+    summary(ValidateNamedSummary),
+    summary_string(ValidateSummaryString)
 {
 }
 





More information about the lldb-commits mailing list