Age | Commit message (Collapse) | Author |
|
Differential Revision: https://reviews.llvm.org/D137287
|
|
This was originally part of https://reviews.llvm.org/D136925, but we decided to move it to a separate patch.
In case it turns out to be controversial, it can be reverted more easily.
Differential Revision: https://reviews.llvm.org/D137104
|
|
Fixes https://github.com/clangd/clangd/issues/1082
Differential Revision: https://reviews.llvm.org/D136925
|
|
This reverts commit 5f820c0f55cd9d4f4520cc92eae0a1c4afe05a54.
Apparently it breaks aarch64 buildbots.
https://lab.llvm.org/buildbot#builders/188/builds/21591
|
|
This makes use of the changes introduced in D134604, in order to
instantiate alias templates witn a final sugared substitution.
This comes at no additional relevant cost.
Since we don't track / unique them in specializations, we wouldn't be
able to resugar them later anyway.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136565
|
|
This fixes a problem where __va_list_tag was not correctly imported,
possibly leading to multiple definitions with different types.
This adds __va_list_tag to it's proper scope, so that the ASTImporter
can find it.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136886
|
|
PragmaIncludes captures the pragma-based header-mapping information, it is used
in the "Location => Header" step to determine the final spelling header for a
symbol (rather than the header directive).
The structure is by design to be used inside the include-cleaner library
and clangd.
Differential Revision: https://reviews.llvm.org/D136071
|
|
Allowing us to test this feature (context: a recent crash in
semantic highlighting.)
Differential Revision: https://reviews.llvm.org/D137063
|
|
Differential Revision: https://reviews.llvm.org/D136951
|
|
Differential Revision: https://reviews.llvm.org/D137064
|
|
|
|
This patch reverts
- commit d4b1964f0554046b1e64908e5c1cd701b25f4c9e
- commit 59f0827e2cf3755834620e7e0b6d946832440f80([clang] Instantiate alias templates with sugar)
As it makes clang fail to pass some code it used to compile.
See comments: https://reviews.llvm.org/D136564#3891065
|
|
Skip template ctors in modernize-use-equals-default,
such constructors may be enabled/disabled via SFINAE,
it is not safe to make them "= default".
Test plan: ninja check-all
Differential revision: https://reviews.llvm.org/D136797
|
|
This makes use of the changes introduced in D134604, in order to
instantiate alias templates witn a final sugared substitution.
This comes at no additional relevant cost.
Since we don't track / unique them in specializations, we wouldn't be
able to resugar them later anyway.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136565
|
|
Since https://reviews.llvm.org/D135506 it's sufficient to only drop UsingDecl here
Differential Revision: https://reviews.llvm.org/D135536
|
|
This reverts commit 4c44c91ad980304c5cca3792115349e68cfafd2b.
|
|
This makes use of the changes introduced in D134604, in order to
instantiate alias templates witn a final sugared substitution.
This comes at no additional relevant cost.
Since we don't track / unique them in specializations, we wouldn't be
able to resugar them later anyway.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136565
|
|
|
|
Provides an initializer for the TypedefInfo.IsUsing member. Previously
this member was uninitialized and would produce random output.
Adds the Description (code comments) to the bitcode reader/writer.
Previously the typedef/using descriptions were lost during the bitcode
round-trip. Adds a test for this.
Differential Revision: https://reviews.llvm.org/D136638
|
|
|
|
Summary:
This brings IncludeCleaner's reference discovery from AST to the parity
with current implementation in clangd. Some highlights:
- Handling of MemberExprs, only the member declaration is marked as
referenced and not the container, unlike clangd.
- Constructor calls, only the constructor and not the container, unlike
clangd.
- All the possible candidates for unresolved overloads, same as clangd.
- All the shadow decls for using-decls, same as clangd.
- Declarations for definitions of enums with an underlying type and
functions, same as clangd.
- Using typelocs, using templatenames and typedefs only reference the
found decl, same as clangd.
- Template specializations only reference the primary template, not the
explicit specializations, to be fixed.
- Expr types aren't marked as used, unlike clangd.
Going forward, we can consider having signals to indicate type of a
reference (e.g. `implicit` signal for type of an expr) so that the
applications can perform a filtering based on their needs.
At the moment the biggest discrepancy is around type of exprs, i.e. not
marking containers for member/constructor accesses. I believe this is
the right model since the declaration of the member and the container
should be available in a single file (modulo macros).
Reviewers: sammccall
Subscribers:
Differential Revision: https://reviews.llvm.org/D132110
|
|
Removes a bunch of obsolete methods in favor of a single one returning
an ArrayRef of TemplateArgument.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136602
|
|
Introduces walkUsed, a very simple version of the public API to enable
incremental development on rest of the pieces.
Differential Revision: https://reviews.llvm.org/D136293
|
|
|
|
Without this, clients are unable to rename often-used symbols in larger
projects.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D136454
|
|
Adjust the automatic fixit to avoid adding superfluous semicolon.
Test plan: ninja check-all
Differential revision: https://reviews.llvm.org/D136399
|
|
This is useful for clients that want to highlight constructors and
destructors different from classes, e.g. like functions.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D134728
|
|
Update links to googletest documentation
No automatic tests, but local manual test: i click it, it opens the googletest documentation.
Reviewed By: sylvestre.ledru
Differential Revision: https://reviews.llvm.org/D136424
|
|
For c++17 (i.e. before c++20) making a private default ctor explicitly defaulted
might expose the previously intentionally disallowed initializations, e.g.
class Tag { Tag() {} friend class Widget; }; is not equivalent to
class Tag { Tag() = default; friend class Widget; };
since in the latter case Tag is treated as an aggregate despite having a declaration
of the default constructor. This diff makes modernize-use-equals-default skip
in-class empty nonpublic default ctors to avoid code breakages.
Test plan: ninja check-all
Differential revision: https://reviews.llvm.org/D136224
|
|
This behavior was once deliberate, but i've yet to find someone who likes it.
The reference behavior is unchanged: the `foo` within ~foo is still considered
a reference to the type. This means rename etc still works.
fixes https://github.com/clangd/clangd/issues/179
Differential Revision: https://reviews.llvm.org/D136212
|
|
Fixed ppc buildbot https://lab.llvm.org/buildbot/#/builders/121/builds/24273 which is using `-DBUILD_SHARED_LIBS=ON`.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D136229
|
|
|
|
The immediate goal is to start producing an HTML report to debug and explain
include-cleaner recommendations.
For now, this includes only the lowest-level piece: a list of the references
found in the source code.
How this fits into future ideas:
- under refs we can also show the headers providing the symbol, which includes
match those headers etc
- we can also annotate the #include lines with which symbols they cover, and
add whichever includes we're suggesting too
- the include-cleaner tool will likely have modes where it emits diagnostics
and/or applies edits, so the HTML report is behind a flag
Differential Revision: https://reviews.llvm.org/D135956
|
|
'definition' modifier
|
|
|
|
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D127403
|
|
|
|
This is a change to how we represent type subsitution in the AST.
Instead of only storing the replaced type, we track the templated
entity we are substituting, plus an index.
We modify MLTAL to track the templated entity at each level.
Otherwise, it's much more expensive to go from the template parameter back
to the templated entity, and not possible to do in some cases, as when
we instantiate outer templates, parameters might still reference the
original entity.
This also allows us to very cheaply lookup the templated entity we saw in
the naming context and find the corresponding argument it was replaced
from, such as for implementing template specialization resugaring.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D131858
|
|
Read typedef and "using" type alias declarations and serialize into the
internal structures. Emit this information in the YAML output. The HTML
and MD generators are unchanged.
Separate out the logic to create the parent namespace or record object
and insert the newly created child into it. This logic was previously
duplicated for every "info" type and is now shared.
To help this, a struct containing the child vectors was separated out so
children can be added generically and without having too many templates.
A small change was made to populateParentNamespaces() to allow using
types that aren't themselves DeclContexts (typedefs are the first
example of this).
Differential Revision: https://reviews.llvm.org/D134371
|
|
|
|
The diagnostics engine is very smart about being passed a NamedDecl to
print as part of a diagnostic; it gets the "right" form of the name,
quotes it properly, etc. However, the result of using an unnamed tag
declaration was to print '' instead of anything useful.
This patch causes us to print the same information we'd have gotten if
we had printed the type of the declaration rather than the name of it,
as that's the most relevant information we can display.
Differential Revision: https://reviews.llvm.org/D134813
|
|
Fixes https://github.com/clangd/clangd/issues/1222. As discussed there, we saw no reason to keep this check.
Differential Revision: https://reviews.llvm.org/D135892
|
|
Need to take a break from this, so write down where we got to.
Differential Revision: https://reviews.llvm.org/D135696
|
|
This check performs an extremely large amount of work (for each variable, it
runs very many full matcher-driven traversals of the whole scope the variable
is defined in).
When (inadvertently) enabled for Fuchsia, it regressed BuildAST times by >10x
(400ms -> 7s on my machine).
Differential Revision: https://reviews.llvm.org/D135829
|
|
Differential Revision: https://reviews.llvm.org/D135857
|
|
Take the library target out of `generate_protos` function so the caller
can decide where to layer the library using the source generated from
the function.
Fixes: https://github.com/llvm/llvm-project/issues/58075
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D135712
|
|
- store NestedNameSpecifier & Loc for the qualifiers
This information was entirely missing from the AST.
- expose the location information for qualifier/identifier/typedefs as typeloc
This allows many traversals/astmatchers etc to handle these generically along
with other references. The decl vs type split can help preserve typedef
sugar when https://github.com/llvm/llvm-project/issues/57659 is resolved.
- fix the SourceRange of UsingEnumDecl to include 'using'.
Fixes https://github.com/clangd/clangd/issues/1283
Differential Revision: https://reviews.llvm.org/D134303
|
|
Before this patch YAML output had default diagnostic level instead of effective level reported to the user on stdout. Wrapper scripts for clang-tidy usually use YAML output and they pick wrong diagnostics level without this patch.
Test Plan: check-clang-tools
Differential Revision: https://reviews.llvm.org/D135367
|
|
This should address the issues found in:
https://lab.llvm.org/buildbot/#/builders/115/builds/35504
|
|
Implements rule ES.75 of C++ Core Guidelines.
Differential Revision: https://reviews.llvm.org/D132461
|