[cfe-dev] JSONCompilationDB Parser

Tobias Grosser tobias at grosser.es
Mon Dec 3 04:04:29 PST 2012


On 12/03/2012 08:05 AM, Manuel Klimek wrote:
> On Fri, Nov 30, 2012 at 9:26 AM, ramneek <onewastedlife at gmail.com
> <mailto:onewastedlife at gmail.com>> wrote:
>
>     Would it be ok if i worked on a patch to move things to a namespace
>     for the first cut while we decide how we can allow plugins.
>     Also we should be ignoring the namespaces that we are not using so
>     it allows applications to add their custom data to while preserving
>     the acceptable file format.
>
>     My proposal is actually simple:
>
>     This is what we have today:
>
>     [
>        {"directory":"/home/user/llvm/build",
>          "command":"/usr/bin/clang++ -Irelative -DSOMEDEF='\"With spaces and quotes.\"'  -c -o file.o file.cc",
>          "file":"file.cc"  },
>>     ]
>
>     We can move it to (cc = compile commands):
>
>     {"cc"  :{"directory":"/home/user/llvm/build",
>
>          "command":"/usr/bin/clang++ -Irelative -DSOMEDEF='\"With spaces and quotes.\"'  -c -o file.o file.cc",
>          "file":"file.cc"  },
>>     ]
>
>
>     One thing that we will have to be careful about is that we will have to patch the cmake compilation command generation facility as well..
>
>     I can look into that as well or make the change such that it is backwards compatible?
>
>
> I'm still torn. While I see the arguments for why being strict might be
> a problem if we plan to change the format, I don't understand the need
> for the namespace / being able to have different things in a single file
> yet.

I also have no opinion about name spaces. However, I think it would be
good if we could ensure clang 3.2 just ignores unknown content. 
Otherwise, the costs of adding new information to that file will be a 
lot higher.

Manuel, do you think this change would still be OK for 3.2?

Cheers
Tobias



More information about the cfe-dev mailing list