[Lldb-commits] [lldb] r366347 - [lldb] Make log for ClangModulesDeclVendor's compiler flag less verbose

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 17 09:51:16 PDT 2019


Author: teemperor
Date: Wed Jul 17 09:51:16 2019
New Revision: 366347

URL: http://llvm.org/viewvc/llvm-project?rev=366347&view=rev
Log:
[lldb] Make log for ClangModulesDeclVendor's compiler flag less verbose

Summary:
Currently the ClangModulesDeclVendor is spamming the expression log with the compiler flags it is using, which creates a log that looks like this:

```
clang

 -fmodules

 -fimplicit-module-maps
```

This patch removes all these newlines and just prints the compiler flags in one line as you see in the command line:

```
clang -fmodules -fimplicit-module-maps [...]
```

Reviewers: shafik, davide

Reviewed By: davide

Subscribers: davide, abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64858

Modified:
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp?rev=366347&r1=366346&r2=366347&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp Wed Jul 17 09:51:16 2019
@@ -632,21 +632,16 @@ ClangModulesDeclVendor::Create(Target &t
       clang::CompilerInstance::createDiagnostics(new clang::DiagnosticOptions,
                                                  new StoringDiagnosticConsumer);
 
-  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
-  if (log)
-    log->PutString("ClangModulesDeclVendor::Create()");
   std::vector<const char *> compiler_invocation_argument_cstrs;
   compiler_invocation_argument_cstrs.reserve(
       compiler_invocation_arguments.size());
-  for (const std::string &arg : compiler_invocation_arguments) {
+  for (const std::string &arg : compiler_invocation_arguments)
     compiler_invocation_argument_cstrs.push_back(arg.c_str());
-    if (log) {
-      log->PutString("\n  ");
-      log->PutString(arg);
-    }
-  }
-  if (log)
-    log->PutString("\n");
+
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
+  LLDB_LOG(log, "ClangModulesDeclVendor's compiler flags {0:$[ ]}",
+           llvm::make_range(compiler_invocation_arguments.begin(),
+                            compiler_invocation_arguments.end()));
 
   std::shared_ptr<clang::CompilerInvocation> invocation =
       clang::createInvocationFromCommandLine(compiler_invocation_argument_cstrs,




More information about the lldb-commits mailing list