[Lldb-commits] [lldb] ddf8146 - [lldb/Reproducers] Add underscore to varaibles in LLDB_RECORD macros

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 4 16:28:47 PST 2020


Author: Jonas Devlieghere
Date: 2020-02-04T16:27:55-08:00
New Revision: ddf814688bd4b2268e8648999b23352e7c6521cb

URL: https://github.com/llvm/llvm-project/commit/ddf814688bd4b2268e8648999b23352e7c6521cb
DIFF: https://github.com/llvm/llvm-project/commit/ddf814688bd4b2268e8648999b23352e7c6521cb.diff

LOG: [lldb/Reproducers] Add underscore to varaibles in LLDB_RECORD macros

Rename all variables used in the LLDB_RECORD macros to start with an
underscore to avoid conflicts with the arguments being recorded.

Added: 
    

Modified: 
    lldb/include/lldb/Utility/ReproducerInstrumentation.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Utility/ReproducerInstrumentation.h b/lldb/include/lldb/Utility/ReproducerInstrumentation.h
index 0bb12047f1ff..d3c46d07c6cf 100644
--- a/lldb/include/lldb/Utility/ReproducerInstrumentation.h
+++ b/lldb/include/lldb/Utility/ReproducerInstrumentation.h
@@ -91,100 +91,99 @@ template <typename... Ts> inline std::string stringify_args(const Ts &... ts) {
       #Method, #Signature)
 
 #define LLDB_RECORD_CONSTRUCTOR(Class, Signature, ...)                         \
-  lldb_private::repro::Recorder sb_recorder(LLVM_PRETTY_FUNCTION,              \
-                                            stringify_args(__VA_ARGS__));      \
-  if (lldb_private::repro::InstrumentationData data =                          \
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION,                \
+                                          stringify_args(__VA_ARGS__));        \
+  if (lldb_private::repro::InstrumentationData _data =                         \
           LLDB_GET_INSTRUMENTATION_DATA()) {                                   \
-    sb_recorder.Record(data.GetSerializer(), data.GetRegistry(),               \
-                       &lldb_private::repro::construct<Class Signature>::doit, \
-                       __VA_ARGS__);                                           \
-    sb_recorder.RecordResult(this, false);                                     \
+    _recorder.Record(_data.GetSerializer(), _data.GetRegistry(),               \
+                     &lldb_private::repro::construct<Class Signature>::doit,   \
+                     __VA_ARGS__);                                             \
+    _recorder.RecordResult(this, false);                                       \
   }
 
 #define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)                                 \
-  lldb_private::repro::Recorder sb_recorder(LLVM_PRETTY_FUNCTION);             \
-  if (lldb_private::repro::InstrumentationData data =                          \
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION);               \
+  if (lldb_private::repro::InstrumentationData _data =                         \
           LLDB_GET_INSTRUMENTATION_DATA()) {                                   \
-    sb_recorder.Record(data.GetSerializer(), data.GetRegistry(),               \
-                       &lldb_private::repro::construct<Class()>::doit);        \
-    sb_recorder.RecordResult(this, false);                                     \
+    _recorder.Record(_data.GetSerializer(), _data.GetRegistry(),               \
+                     &lldb_private::repro::construct<Class()>::doit);          \
+    _recorder.RecordResult(this, false);                                       \
   }
 
 #define LLDB_RECORD_METHOD(Result, Class, Method, Signature, ...)              \
-  lldb_private::repro::Recorder sb_recorder(                                   \
-      LLVM_PRETTY_FUNCTION, stringify_args(*this, __VA_ARGS__));               \
-  if (lldb_private::repro::InstrumentationData data =                          \
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION,                \
+                                          stringify_args(*this, __VA_ARGS__)); \
+  if (lldb_private::repro::InstrumentationData _data =                         \
           LLDB_GET_INSTRUMENTATION_DATA()) {                                   \
-    sb_recorder.Record(                                                        \
-        data.GetSerializer(), data.GetRegistry(),                              \
-        &lldb_private::repro::invoke<Result(Class::*) Signature>::method<(     \
-            &Class::Method)>::doit,                                            \
-        this, __VA_ARGS__);                                                    \
+    _recorder.Record(_data.GetSerializer(), _data.GetRegistry(),               \
+                     &lldb_private::repro::invoke<Result(                      \
+                         Class::*) Signature>::method<(&Class::Method)>::doit, \
+                     this, __VA_ARGS__);                                       \
   }
 
 #define LLDB_RECORD_METHOD_CONST(Result, Class, Method, Signature, ...)        \
-  lldb_private::repro::Recorder sb_recorder(                                   \
-      LLVM_PRETTY_FUNCTION, stringify_args(*this, __VA_ARGS__));               \
-  if (lldb_private::repro::InstrumentationData data =                          \
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION,                \
+                                          stringify_args(*this, __VA_ARGS__)); \
+  if (lldb_private::repro::InstrumentationData _data =                         \
           LLDB_GET_INSTRUMENTATION_DATA()) {                                   \
-    sb_recorder.Record(                                                        \
-        data.GetSerializer(), data.GetRegistry(),                              \
+    _recorder.Record(                                                          \
+        _data.GetSerializer(), _data.GetRegistry(),                            \
         &lldb_private::repro::invoke<Result(                                   \
             Class::*) Signature const>::method_const<(&Class::Method)>::doit,  \
         this, __VA_ARGS__);                                                    \
   }
 
 #define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)                      \
-  lldb_private::repro::Recorder sb_recorder(LLVM_PRETTY_FUNCTION,              \
-                                            stringify_args(*this));            \
-  if (lldb_private::repro::InstrumentationData data =                          \
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION,                \
+                                          stringify_args(*this));              \
+  if (lldb_private::repro::InstrumentationData _data =                         \
           LLDB_GET_INSTRUMENTATION_DATA()) {                                   \
-    sb_recorder.Record(data.GetSerializer(), data.GetRegistry(),               \
-                       &lldb_private::repro::invoke<Result (                   \
-                           Class::*)()>::method<(&Class::Method)>::doit,       \
-                       this);                                                  \
+    _recorder.Record(_data.GetSerializer(), _data.GetRegistry(),               \
+                     &lldb_private::repro::invoke<Result (                     \
+                         Class::*)()>::method<(&Class::Method)>::doit,         \
+                     this);                                                    \
   }
 
 #define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)                \
-  lldb_private::repro::Recorder sb_recorder(LLVM_PRETTY_FUNCTION,              \
-                                            stringify_args(*this));            \
-  if (lldb_private::repro::InstrumentationData data =                          \
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION,                \
+                                          stringify_args(*this));              \
+  if (lldb_private::repro::InstrumentationData _data =                         \
           LLDB_GET_INSTRUMENTATION_DATA()) {                                   \
-    sb_recorder.Record(                                                        \
-        data.GetSerializer(), data.GetRegistry(),                              \
+    _recorder.Record(                                                          \
+        _data.GetSerializer(), _data.GetRegistry(),                            \
         &lldb_private::repro::invoke<Result (                                  \
             Class::*)() const>::method_const<(&Class::Method)>::doit,          \
         this);                                                                 \
   }
 
 #define LLDB_RECORD_STATIC_METHOD(Result, Class, Method, Signature, ...)       \
-  lldb_private::repro::Recorder sb_recorder(LLVM_PRETTY_FUNCTION,              \
-                                            stringify_args(__VA_ARGS__));      \
-  if (lldb_private::repro::InstrumentationData data =                          \
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION,                \
+                                          stringify_args(__VA_ARGS__));        \
+  if (lldb_private::repro::InstrumentationData _data =                         \
           LLDB_GET_INSTRUMENTATION_DATA()) {                                   \
-    sb_recorder.Record(data.GetSerializer(), data.GetRegistry(),               \
-                       static_cast<Result(*) Signature>(&Class::Method),       \
-                       __VA_ARGS__);                                           \
+    _recorder.Record(_data.GetSerializer(), _data.GetRegistry(),               \
+                     static_cast<Result(*) Signature>(&Class::Method),         \
+                     __VA_ARGS__);                                             \
   }
 
 #define LLDB_RECORD_STATIC_METHOD_NO_ARGS(Result, Class, Method)               \
-  lldb_private::repro::Recorder sb_recorder(LLVM_PRETTY_FUNCTION);             \
-  if (lldb_private::repro::InstrumentationData data =                          \
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION);               \
+  if (lldb_private::repro::InstrumentationData _data =                         \
           LLDB_GET_INSTRUMENTATION_DATA()) {                                   \
-    sb_recorder.Record(data.GetSerializer(), data.GetRegistry(),               \
-                       static_cast<Result (*)()>(&Class::Method));             \
+    _recorder.Record(_data.GetSerializer(), _data.GetRegistry(),               \
+                     static_cast<Result (*)()>(&Class::Method));               \
   }
 
-#define LLDB_RECORD_RESULT(Result) sb_recorder.RecordResult(Result, true);
+#define LLDB_RECORD_RESULT(Result) _recorder.RecordResult(Result, true);
 
 /// The LLDB_RECORD_DUMMY macro is special because it doesn't actually record
 /// anything. It's used to track API boundaries when we cannot record for
 /// technical reasons.
 #define LLDB_RECORD_DUMMY(Result, Class, Method, Signature, ...)               \
-  lldb_private::repro::Recorder sb_recorder(LLVM_PRETTY_FUNCTION,              \
-                                            stringify_args(__VA_ARGS__));
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION,                \
+                                          stringify_args(__VA_ARGS__));
 #define LLDB_RECORD_DUMMY_NO_ARGS(Result, Class, Method)                       \
-  lldb_private::repro::Recorder sb_recorder(LLVM_PRETTY_FUNCTION);
+  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION);
 
 namespace lldb_private {
 namespace repro {
@@ -699,7 +698,6 @@ class Recorder {
       serializer.SerializeAll(0);
       m_result_recorded = true;
     }
-
   }
 
   /// Records a single function call.
@@ -722,7 +720,6 @@ class Recorder {
     // Record result.
     serializer.SerializeAll(0);
     m_result_recorded = true;
-
   }
 
   /// Record the result of a function call.


        


More information about the lldb-commits mailing list