forked from OSchip/llvm-project
588db1ccff
Currently our strategy for getting header compile flags is something like: A) look for flags for the header in compile_commands.json This basically never works, build systems don't generate this info. B) try to match to an impl file in compile_commands.json and use its flags This only (mostly) works if the headers are in the same project. C) give up and use fallback flags This kind of works for stdlib in the default configuration, and otherwise doesn't. Obviously there are big gaps here. This patch inserts a new attempt between A and B: if the header is transitively included by any open file (whether same project or not), then we use its compile command. This doesn't make any attempt to solve some related problems: - parsing non-self-contained header files in context (importing PP state) - using the compile flags of non-opened candidate files found in the index Fixes https://github.com/clangd/clangd/issues/123 Fixes https://github.com/clangd/clangd/issues/695 See https://github.com/clangd/clangd/issues/519 Differential Revision: https://reviews.llvm.org/D97351 |
||
---|---|---|
.. | ||
clang-apply-replacements | ||
clang-change-namespace | ||
clang-doc | ||
clang-include-fixer | ||
clang-move | ||
clang-query | ||
clang-reorder-fields | ||
clang-tidy | ||
clangd | ||
docs | ||
modularize | ||
pp-trace | ||
test | ||
tool-template | ||
unittests | ||
.gitignore | ||
CMakeLists.txt | ||
CODE_OWNERS.TXT | ||
LICENSE.TXT | ||
README.txt |
README.txt
//===----------------------------------------------------------------------===// // Clang Tools repository //===----------------------------------------------------------------------===// Welcome to the repository of extra Clang Tools. This repository holds tools that are developed as part of the LLVM compiler infrastructure project and the Clang frontend. These tools are kept in a separate "extra" repository to allow lighter weight checkouts of the core Clang codebase. This repository is only intended to be checked out inside of a full LLVM+Clang tree, and in the 'tools/extra' subdirectory of the Clang checkout. All discussion regarding Clang, Clang-based tools, and code in this repository should be held using the standard Clang mailing lists: http://lists.llvm.org/mailman/listinfo/cfe-dev Code review for this tree should take place on the standard Clang patch and commit lists: http://lists.llvm.org/mailman/listinfo/cfe-commits If you find a bug in these tools, please file it in the LLVM bug tracker: http://llvm.org/bugs/