| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
Really we want these to be shown to the client, but the path to do so involves
storing them in
Bandaid for https://github.com/clangd/clangd/issues/1408
See https://github.com/clangd/clangd/issues/1399 for motivation
Differential Revision: https://reviews.llvm.org/D139088
|
|
|
|
|
|
|
| |
ASTMatchers are pulling in lots of dependencies that we don't really
need for just finding a decl based on name. So use a simple RAV instead.
Differential Revision: https://reviews.llvm.org/D139093
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Creates a one to many mapping, by returning all the possible locations
providing a symbol. Also includes an "is definition" signal for the
location, that can be used for ranking afterwards.
This also takes care of stdlib symbols by having a variant of locations.
Depends on D135859.
Differential Revision: https://reviews.llvm.org/D135953
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D137340
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The google-objc-avoid-throwing-exception check enforces the Google
Objective-C Style Guide's prohibition on throwing exceptions in user
code but the check incorrectly triggers findings for code emitted from
system headers. This commit suppresses any findings that do not have
valid locations or are emitted from macros in system headers.
Avoid Throwing Exceptions, Google Objective-C Style Guide:
https://github.com/google/styleguide/blob/gh-pages/objcguide.md#avoid-throwing-exceptions
Test Notes:
Ran clang-tidy lit tests.
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D137738
|
|
|
|
|
|
|
|
| |
Requiring everything that wants to match Includes to depend on Record is weird.
This isn't lightweight enough that it feels perfect in Types, could be its own
header instead. But pragmatically it doesn't add bad deps, and is widely used.
Differential Revision: https://reviews.llvm.org/D139014
|
|
|
|
|
|
|
|
|
| |
This is needed to accurately remove headers with tooling::IncludeHeaders in the
rare cases where <foo> and "foo" resolve to something different.
This is also nice to have in HTML report and command-line -print=changes output.
Differential Revision: https://reviews.llvm.org/D139018
|
| |
|
|
|
|
|
|
|
|
| |
Fixes a warning about a potentially unsupported template argument
deduction by explicitly specifying the template type in std::lock_guard.
Patch By: brettw
Differential Revision: https://reviews.llvm.org/D138961
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously file naming and directory layout was handled on a per Info
object basis by ClangDocMain and the generators blindly wrote to the
files given. This means all generators must use the same file layout and
caused problems where multiple objects mapped to the same file. The
object collision problem happens most easily with template
specializations because the template parameters are not part of the
"name".
This patch moves the responsibility for output file organization to the
generators. Currently HTML and MD use the same structure as before. But
they now collect all objects that map to a given file and combine them,
avoiding the corruption problems.
Converts the YAML generator to naming files based on USR in one
directory. This is easier for downstream tools to manage and avoids the
naming problems with template specializations. Since this change
requires backward-incompatible output changes to referenced files anyway
(since each one is now an array), this is a good time to introduce this
change.
Differential Revision: https://reviews.llvm.org/D138073
|
|
|
|
|
|
| |
Reviewed By: #clang-language-wg, erichkeane
Differential Revision: https://reviews.llvm.org/D138918
|
|
|
|
|
|
| |
Implement support for begin_keep/end_keep pragmas.
Differential Revision: https://reviews.llvm.org/D138797
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change is focussed on simplifying `Support/Host.h` to only do
target detection. In this case, this function is close in usage to
existing functions in `Support/Threading.h`, so I moved it into there.
The function is also renamed to `llvm::get_physical_cores()` to match
the style of threading's functions.
The big change here is that now if you have threading disabled,
`llvm::get_physical_cores()` will return -1, as if it had not been able
to work out the right info. This is due to how Threading.cpp includes
OS-specific code/headers. This seems ok, as if threading is disabled,
LLVM should not need to know the number of physical cores.
Differential Revision: https://reviews.llvm.org/D137836
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As strange as it seems to our files-are-strings view of the world, some editors
that treat files as arrays of lines can get confused about whether the last line
has a newline or not.
The consequences of failing to handle a bad incremental update are catastrophic.
If an update would be valid except for a missing newline at end of file, pretend
one exists.
This fixes problems still present in neovim where deleting all text often leads
to a desync shortly afterwards: https://github.com/neovim/neovim/issues/17085
Differential Revision: https://reviews.llvm.org/D135508
|
|
|
|
|
|
|
|
|
|
|
| |
In confusable-identifiers.rst the description refers to wrong Unicode code point.
The shown code point is U+1D41F, not U+1234.
Updated the code point and it's description.
Fixes #58934
Differential Revision: https://reviews.llvm.org/D138838
|
| |
|
|
|
|
|
|
|
|
|
| |
The plan is to intersect this list with the checks selected per config.
This is not yet done, but the initial list is checked in as a baseline.
https://github.com/clangd/clangd/issues/1337
Differential Revision: https://reviews.llvm.org/D138491
|
|
|
|
|
|
|
|
|
|
|
| |
Based on include-cleaner's version, but:
- remove assert that can fail for input `/\<newline>* */`
- assert was also checking the wrong condition: that the prefix *differed* from
either `//` or from `/*`. Avoid use of strncmp where we can.
- add a comment that the brittleness of the text matching is intentional
Differential Revision: https://reviews.llvm.org/D138780
|
| |
|
|
|
|
|
|
|
|
| |
Save file IDs of IWYU private headers and report them as private.
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D138678
|
|
|
|
|
|
|
|
| |
This patch fixes:
clang-tools-extra/include-cleaner/lib/HTMLReport.cpp:240:51: error:
missing field 'Locations' initializer
[-Werror,-Wmissing-field-initializers]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in modernize-use-nullptr
The check has produced false positives when checking the default implementation of the spaceship operator.
The default implementation should be skipped by the check.
Modified the existing test so that the check runs into the bug without this fix and add another test case.
Fixes #53961.
Patch by Jens Massberg.
Reviewed By: ilya-biryukov
Differential Revision: https://reviews.llvm.org/D138701
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 5577207d6d3e0642ea047a8dfbfcf3ad372a7f25.
This breaks building LLVM on recent macOS. Error messages below:
llvm/lib/Support/Threading.cpp:190:3: error: use of undeclared
identifier 'sysctlbyname'
sysctlbyname("hw.physicalcpu", &count, &len, NULL, 0);
^
llvm/lib/Support/Threading.cpp:193:13: error: use of undeclared
identifier 'CTL_HW'
nm[0] = CTL_HW;
^
llvm/lib/Support/Threading.cpp:194:13: error: use of undeclared identifier 'HW_AVAILCPU'
nm[1] = HW_AVAILCPU;
^
llvm/lib/Support/Threading.cpp:195:5: error: use of undeclared identifier 'sysctl'
sysctl(nm, 2, &count, &len, NULL, 0);
^
|
|
|
|
|
|
|
|
|
|
| |
This change is focussed on simplifying `Support/Host.h` to only do
target detection. In this case, this function is close in usage to
existing functions in `Support/Threading.h`, so I moved it into there.
The function is also renamed to `llvm::get_physical_cores()` to match
the style of threading's functions.
Differential Revision: https://reviews.llvm.org/D137836
|
|
|
|
|
|
|
| |
Targets and Refs are 1:1, so merge them.
Don't sort Refs array we keep indices into. (Currently we're done using
those indices by the time we sort, but this is fragile)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Demo: https://htmlpreview.github.io/?https://gist.githubusercontent.com/sam-mccall/9730f933a2cf2e003365520b6636f731/raw/7911d8251ceab7c244e0510285105027cd0a9403/PathMapping.cpp.html
Header insertion doesn't actually work that well (not this patch's fault):
- we don't have ranking of locations/headers yet, so inserted header is pretty
random
- on my system, we get a lot of absolute "/usr/bin/../include/..." paths.
This is a HeaderSearch bug introduced in D60873 that I'll send a fix for
Differential Revision: https://reviews.llvm.org/D138676
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D138649
|
|
|
|
|
|
|
| |
For now, we decided not to add operator< or handle other variants.
(If we do so in future we may want to extract a base class).
Differential Revision: https://reviews.llvm.org/D138648
|
|
|
|
|
|
|
|
| |
Records macro references in #ifdef clauses as ambiguous.
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D138559
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch replaces those occurrences of NoneType that would trigger
an error if the definition of NoneType were missing in None.h.
To keep this patch focused, I am deliberately not replacing None with
std::nullopt in this patch or updating comments. They will be
addressed in subsequent patches.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Differential Revision: https://reviews.llvm.org/D138539
|
|
|
|
|
|
| |
Demo: https://htmlpreview.github.io/?https://gist.githubusercontent.com/sam-mccall/ecee6869e37af3db28089b64d8dce806/raw/8736e64c45af411e2c2d72adaed2dfc4410a5b36/ASTTests.html%25202
Differential Revision: https://reviews.llvm.org/D138219
|
|
|
|
|
|
|
| |
This reverts commit f8a469fc572778d05b72f34a772082cf3abd3cda.
The test in single-file-public.cpp breaks on Mac, due to an unknown
regextype in the find command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously file naming and directory layout was handled on a per Info
object basis by ClangDocMain and the generators blindly wrote to the
files given. This means all generators must use the same file layout and
caused problems where multiple objects mapped to the same file. The
object collision problem happens most easily with template
specializations because the template parameters are not part of the
"name".
This patch moves the responsibility for output file organization to the
generators. Currently HTML and MD use the same structure as before. But
they now collect all objects that map to a given file and combine them,
avoiding the corruption problems.
Converts the YAML generator to naming files based on USR in one
directory. This is easier for downstream tools to manage and avoids
the naming problems with template specializations. Since this change
requires backward-incompatible output changes to referenced files anyway
(since each one is now an array), this is a good time to introduce this
change.
Differential Revision: https://reviews.llvm.org/D138073
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since std::optional does not offer getPointer(), this patch replaces
X.getPointer() with &*X to make the migration from llvm::Optional to
std::optional easier.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Differential Revision: https://reviews.llvm.org/D138466
|
|
|
|
|
|
|
|
|
|
|
| |
... in semantic highlighting.
These specifiers cannot be identified by simple lexing (since e.g.
variables with these names can legally be declared), which means they
should be semantic tokens.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D137943
|
|
|
|
| |
This avoids a slow step after timing tidy checks for https://github.com/clangd/clangd/issues/1337
|
|
|
|
|
|
| |
This is less plumbing and clutter in ClangdMain.cpp.
Having --check-lines imply completion was just about minimizing plumbing
I think, so make that explicit.
|
|
|
|
|
|
|
|
|
|
| |
misc-const-correctness is so catastrophically slow that we need to block it
from running. But we need a way to detect this without breaking users first.
This is part of a plan to run only fast checks by default.
More details in https://github.com/clangd/clangd/issues/1337
Differential Revision: https://reviews.llvm.org/D136082
|
|
|
|
| |
check, NFC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is useful where tests previously encoded information in the name
names of ranges and points. Currently, this is pretty limited because
names consist of only alphanumeric characters and '_'.
With this patch, we can keep the names simple and attach optional
payloads to ranges and points instead.
The new syntax should be fully backwards compatible (if I haven't missed
anything). I tested this against clangd unit tests and everything still passes.
Differential Revision: https://reviews.llvm.org/D137909
|
|
|
|
|
|
|
|
| |
And use it findHeaders. findHeaders now finds all header candidates
given a symbol location (these headers will be attached with proper
signals, in a followup patch).
Differential Revision: https://reviews.llvm.org/D137698
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure to use clang_target_link_libraries, which skips linking
against libraries and links against libclang-cpp instead, if
LLVM_LINK_LLVM_DYLIB is enabled.
This fixes errors like these:
ld.lld: error: duplicate symbol: clang::PPCallbacks::~PPCallbacks()
>>> defined at libclangLex.a(PPCallbacks.cpp.obj)
>>> defined at libclang-cpp.dll
|
| |
|
|
|
|
|
|
|
| |
and apply an include-cleaner fix for the tool itself:)
addPPCallbacks requires the vtable of PPChainedCallbacks and needs a clangLex
dependency.
|
| |
|
|
|
|
|
|
|
|
|
| |
Current version complains unused using-declaration even if the target
user-defined literal is used.
Reviewed By: ymandel
Differential Revision: https://reviews.llvm.org/D138204
|