From ddf814688bd4b2268e8648999b23352e7c6521cb Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 4 Feb 2020 16:21:31 -0800 Subject: [PATCH] [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. --- .../lldb/Utility/ReproducerInstrumentation.h | 103 +++++++++--------- 1 file changed, 50 insertions(+), 53 deletions(-) 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 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::doit, \ - __VA_ARGS__); \ - sb_recorder.RecordResult(this, false); \ + _recorder.Record(_data.GetSerializer(), _data.GetRegistry(), \ + &lldb_private::repro::construct::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::doit); \ - sb_recorder.RecordResult(this, false); \ + _recorder.Record(_data.GetSerializer(), _data.GetRegistry(), \ + &lldb_private::repro::construct::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::method<( \ - &Class::Method)>::doit, \ - this, __VA_ARGS__); \ + _recorder.Record(_data.GetSerializer(), _data.GetRegistry(), \ + &lldb_private::repro::invoke::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::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::method<(&Class::Method)>::doit, \ - this); \ + _recorder.Record(_data.GetSerializer(), _data.GetRegistry(), \ + &lldb_private::repro::invoke::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::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(&Class::Method), \ - __VA_ARGS__); \ + _recorder.Record(_data.GetSerializer(), _data.GetRegistry(), \ + static_cast(&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(&Class::Method)); \ + _recorder.Record(_data.GetSerializer(), _data.GetRegistry(), \ + static_cast(&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 @@ public: serializer.SerializeAll(0); m_result_recorded = true; } - } /// Records a single function call. @@ -722,7 +720,6 @@ public: // Record result. serializer.SerializeAll(0); m_result_recorded = true; - } /// Record the result of a function call.