================ @@ -0,0 +1,170 @@ +//===- JSONBuildDatabase.h --------------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// The JSONBuildDatabase finds build databases supplied as a file +// 'compile_commands.json'. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_TOOLING_JSONBUILDDATABASE_H +#define LLVM_CLANG_TOOLING_JSONBUILDDATABASE_H + +#include "clang/Basic/LLVM.h" +#include "clang/Tooling/CompilationDatabase.h" +#include "clang/Tooling/FileMatchTrie.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringSet.h" +#include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/SourceMgr.h" +#include "llvm/Support/YAMLParser.h" +#include <memory> +#include <string> +#include <tuple> +#include <utility> +#include <vector> + +namespace clang { +namespace tooling { + +/// A JSON based build database. +/// +/// JSON compilation database files must contain a list of JSON objects which +/// provide the command lines in the attributes 'directory', 'command', +/// 'arguments' and 'file': +/// [ +/// { "directory": "<working directory of the compile>", +/// "command": "<compile command line>", +/// "file": "<path to source file>" +/// }, +/// { "directory": "<working directory of the compile>", +/// "arguments": ["<raw>", "<command>" "<line>" "<parameters>"], +/// "file": "<path to source file>" +/// }, +/// ... +/// ] +/// Each object entry defines one compile action. The specified file is +/// considered to be the main source file for the translation unit. +/// +/// 'command' is a full command line that will be unescaped. +/// +/// 'arguments' is a list of command line arguments that will not be unescaped. +/// +/// JSON build databases can for example be generated in CMake projects +/// by setting the flag -DCMAKE_EXPORT_BUILD_DATABASE. ---------------- ChuanqiXu9 wrote:
I failed to understand this. I thought you're going to support cmake's build database for modules. But the comment looks like the old compilation database. So what's the point? https://github.com/llvm/llvm-project/pull/199384 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
