From: Manuel Klimek Date: Wed, 13 Jun 2012 19:40:46 +0000 (+0000) Subject: Doc fixed as proposed (and mostly contributed) by David Roethlisberger. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1156afd1dfbfe372c71a825b2003bca4febe7670;p=clang Doc fixed as proposed (and mostly contributed) by David Roethlisberger. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158415 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/JSONCompilationDatabase.html b/docs/JSONCompilationDatabase.html index d5c9725062..007825a35d 100644 --- a/docs/JSONCompilationDatabase.html +++ b/docs/JSONCompilationDatabase.html @@ -13,11 +13,11 @@

JSON Compilation Database Format Specification

-

This document describes a format to specify how to replay +

This document describes a format for specifying how to replay single compilations independently of the build system.

Background

-

Tools based on the C++ AST need full information how to +

Tools based on the C++ Abstract Syntax Tree need full information how to parse a translation unit. Usually this information is implicitly available in the build system, but running tools as part of the build system is not necessarily the best solution: @@ -37,7 +37,7 @@ according to the build dependency graph.

Supported Systems

-

Currently CMake support generation of compilation +

Currently CMake (since 2.8.5) supports generation of compilation databases for Unix Makefile builds (Ninja builds in the works) with the option CMAKE_EXPORT_COMPILE_COMMANDS.

Clang's tooling interface supports reading compilation databases; see @@ -46,9 +46,9 @@ is in the works.

Format

A compilation database is a JSON file, which consist of an array of -objects, where each object specifies one way a translation unit +"command objects", where each command object specifies one way a translation unit is compiled in the project.

-

Each object contains the translation unit's main file, the working +

Each command object contains the translation unit's main file, the working directory of the compile run and the actual compile command.

Example:

@@ -66,7 +66,7 @@ in the command or file fields must be either absolute or relative
 this directory.
 
  • file: The main translation unit source processed by this compilation step. This is used by tools as the key into the compilation database. There can be multiple -compile objects for the same file, for example if the same translation unit is +command objects for the same file, for example if the same source file is compiled with different configurations.
  • command: The compile command executed. After JSON unescaping, this must be a valid command to rerun the exact compilation step for the translation unit in