diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-24 17:56:10 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-24 17:56:10 +0000 |
commit | 63e5fb76ecfed3434252868d8cf07d676f979f2f (patch) | |
tree | 349d6bd303f53aa57b988dee284c7f264404a8fc /lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp | |
parent | 2bf871be4c35d70db080dde789cf9bb334c04057 (diff) | |
download | bcm5719-llvm-63e5fb76ecfed3434252868d8cf07d676f979f2f.tar.gz bcm5719-llvm-63e5fb76ecfed3434252868d8cf07d676f979f2f.zip |
[Logging] Replace Log::Printf with LLDB_LOG macro (NFC)
This patch replaces explicit calls to log::Printf with the new LLDB_LOGF
macro. The macro is similar to LLDB_LOG but supports printf-style format
strings, instead of formatv-style format strings.
So instead of writing:
if (log)
log->Printf("%s\n", str);
You'd write:
LLDB_LOG(log, "%s\n", str);
This change was done mechanically with the command below. I replaced the
spurious if-checks with vim, since I know how to do multi-line
replacements with it.
find . -type f -name '*.cpp' -exec \
sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" +
Differential revision: https://reviews.llvm.org/D65128
llvm-svn: 366936
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp')
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp index 2dae5b7022f..6e8aa688a73 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp @@ -90,21 +90,18 @@ ClangUserExpression::~ClangUserExpression() {} void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Status &err) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); - if (log) - log->Printf("ClangUserExpression::ScanContext()"); + LLDB_LOGF(log, "ClangUserExpression::ScanContext()"); m_target = exe_ctx.GetTargetPtr(); if (!(m_allow_cxx || m_allow_objc)) { - if (log) - log->Printf(" [CUE::SC] Settings inhibit C++ and Objective-C"); + LLDB_LOGF(log, " [CUE::SC] Settings inhibit C++ and Objective-C"); return; } StackFrame *frame = exe_ctx.GetFramePtr(); if (frame == nullptr) { - if (log) - log->Printf(" [CUE::SC] Null stack frame"); + LLDB_LOGF(log, " [CUE::SC] Null stack frame"); return; } @@ -112,8 +109,7 @@ void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Status &err) { lldb::eSymbolContextBlock); if (!sym_ctx.function) { - if (log) - log->Printf(" [CUE::SC] Null function"); + LLDB_LOGF(log, " [CUE::SC] Null function"); return; } @@ -121,16 +117,14 @@ void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Status &err) { Block *function_block = sym_ctx.GetFunctionBlock(); if (!function_block) { - if (log) - log->Printf(" [CUE::SC] Null function block"); + LLDB_LOGF(log, " [CUE::SC] Null function block"); return; } CompilerDeclContext decl_context = function_block->GetDeclContext(); if (!decl_context) { - if (log) - log->Printf(" [CUE::SC] Null decl context"); + LLDB_LOGF(log, " [CUE::SC] Null decl context"); return; } @@ -527,8 +521,7 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager, if (!PrepareForParsing(diagnostic_manager, exe_ctx, /*for_completion*/ false)) return false; - if (log) - log->Printf("Parsing the following code:\n%s", m_transformed_text.c_str()); + LLDB_LOGF(log, "Parsing the following code:\n%s", m_transformed_text.c_str()); //////////////////////////////////// // Set up the target and compiler @@ -726,8 +719,7 @@ bool ClangUserExpression::Complete(ExecutionContext &exe_ctx, if (!PrepareForParsing(diagnostic_manager, exe_ctx, /*for_completion*/ true)) return false; - if (log) - log->Printf("Parsing the following code:\n%s", m_transformed_text.c_str()); + LLDB_LOGF(log, "Parsing the following code:\n%s", m_transformed_text.c_str()); ////////////////////////// // Parse the expression |