forked from OSchip/llvm-project
![]() Summary: Currently, we pick the first declaration of a symbol in a TU, which is considered canonical in the clangIndex, as the canonical declaration in clangd. This causes forward declarations that might appear in a random header to be used as a canonical declaration, which is not desirable for features like go-to-declaration or include insertion. For example, for class X, we would consider the forward declaration in fwd.h to be the canonical declaration, while the preferred canonical declaration should be the actual definition in x.h. ``` // fwd.h class X; // forward decl // x.h class X {}; ``` This patch fixes the issue by making symbol collector favor the actual definition of a TagDecl (i.e. class/struct/enum/union) found in a header file over the first seen declarations in a TU. Other symbol types like functions are not handled because using the first seen declarations as canonical declarations is usually a good heuristic for them. Reviewers: sammccall Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43823 llvm-svn: 326313 |
||
---|---|---|
clang | ||
clang-tools-extra | ||
compiler-rt | ||
debuginfo-tests | ||
libclc | ||
libcxx | ||
libcxxabi | ||
libunwind | ||
lld | ||
lldb | ||
llgo | ||
llvm | ||
openmp | ||
parallel-libs | ||
polly | ||
README.md |
README.md
Low Level Virtual Machine (LLVM)
This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.