================
@@ -387,6 +396,9 @@ template <typename Cat> Log *GetLog(Cat mask) {
     if (log_private && error_private) {                                        
\
       log_private->FormatError(::std::move(error_private), __FILE__, __func__, 
\
                                __VA_ARGS__);                                   
\
+    } else if (::lldb_private::Log *log_error = GetLLDBErrorLog()) {           
\
----------------
labath wrote:

I'd recommend structuring this in a way that avoids evaluating `__VA_ARGS__` 
more than once. You could e.g. insert a `if(!log_private) log_private = 
GetLLDBErrorLog()` statement before this `if`.

(I know that the macro gets dynamically evaluated only once, but I was recently 
reading about how this innocent-looking macro in the linux kernel exploded to 
several dozen kilobytes of goo. We're not there yet, but this should help 
anyone looking at the preprocessed output, and also help the compiler generate 
less code)

https://github.com/llvm/llvm-project/pull/111911
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to