[PATCH] D10365: Add cmd to compilation database file format

Daniel Dilts via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 12 09:51:16 PDT 2015

diltsman added inline comments.

Comment at: ../llvm/tools/clang/lib/Tooling/JSONCompilationDatabase.cpp:299
@@ +298,3 @@
+        if (CommandFound) {
+          ErrorMessage = "Multiple command and arguments found";
+          return false;
klimek wrote:
> Any reason we don't want to allow both, but prefer the arguments?
I don't see how the arguments are preferred.

I was thinking that the user would either want to use the command line or list arguments.  Is there a case where someone would want to do both?

Also, if we permit both, do we need to do any kind of uniquing?

Comment at: ../llvm/tools/clang/lib/Tooling/JSONCompilationDatabase.cpp:302-304
@@ +301,5 @@
+        }
+        for (llvm::yaml::SequenceNode::iterator CI = SequenceString->begin(),
+          CE = SequenceString->end();
+          CI != CE; ++CI) {
+          SmallString<128> CommandStorage;
klimek wrote:
> Can we use for-range loops with auto?
I changed two other locations to range-based for loops, too.


More information about the cfe-commits mailing list