]> granicus.if.org Git - clang/commit
Add structed way to express command line options in the compilation database.
authorManuel Klimek <klimek@google.com>
Fri, 14 Aug 2015 09:55:36 +0000 (09:55 +0000)
committerManuel Klimek <klimek@google.com>
Fri, 14 Aug 2015 09:55:36 +0000 (09:55 +0000)
commite5e9bbb0c9f26823482c92c0f250da7e9a5dd9cf
treea96ae3969864522410bbb3f4cdfd432e60804a99
parentc1f5dc002f2837a5cfc39933b8df254dde6aa354
Add structed way to express command line options in the compilation database.

Currently, arguments are passed via the string attribute 'command',
assuming a shell-escaped / quoted command line to extract the original
arguments. This works well enough on Unix systems, but turns out to be
problematic for Windows tools to generate.

This CL adds a new attribute 'arguments', an array of strings, which
specifies the exact command line arguments. If 'arguments' is available
in the compilation database, it is preferred to 'commands'.

Currently there is no plan to retire 'commands': there are enough
different use cases where users want to create their own mechanism for
creating compilation databases, that it doesn't make sense to force them
all to implement shell command line parsing.

Patch by Daniel Dilts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245036 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Tooling/JSONCompilationDatabase.h
lib/Tooling/JSONCompilationDatabase.cpp
unittests/Tooling/CompilationDatabaseTest.cpp