]> granicus.if.org Git - clang/commit
[Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.
authorSam McCall <sam.mccall@gmail.com>
Thu, 9 Nov 2017 10:37:39 +0000 (10:37 +0000)
committerSam McCall <sam.mccall@gmail.com>
Thu, 9 Nov 2017 10:37:39 +0000 (10:37 +0000)
commit9336389b0ff98ac05d2fe5781ae4bed492dc891e
treef3c1d06476e54b9e86c26ff0c3c0794542105d86
parentb0146f934b6fe813689ec0058323e52bc12dec23
[Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.

Summary:
This is an alternative to JSONCompilationDatabase for simple projects that
don't use a build system such as CMake.
(You can also drop one in ~, to make your tools use e.g. C++11 by default)

There's no facility for varying flags per-source-file or per-machine.
Possibly this could be accommodated backwards-compatibly using cpp, but even if
not the simplicity seems worthwhile for the cases that are addressed.

Tested with clangd, works great! (requires clangd restart)

Reviewers: klimek

Subscribers: ilya-biryukov, cfe-commits

Differential Revision: https://reviews.llvm.org/D39799

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317777 91177308-0d34-0410-b5e6-96231b3b80d8
docs/JSONCompilationDatabase.rst
include/clang/Tooling/CompilationDatabase.h
lib/Tooling/CompilationDatabase.cpp
test/Tooling/Inputs/fixed-header.h [new file with mode: 0644]
test/Tooling/fixed-database.cpp [new file with mode: 0644]