| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a Record is declared in the global namespace, clang-doc serializes
it as a child of the global namespace, so the global namespace is now
one if its parent namespaces. This namespace was not being included in
the list of namespaces of the Info causing paths to be incorrect and the
index rendered incorrectly.
Affected tests have been fixed.
Differential revision: https://reviews.llvm.org/D66298
llvm-svn: 369123
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bitcode writer was not emitting the corresponding record for the Access attribute of a FunctionInfo. This has been added.
AS_none was being used as the default value for any AcesssSpecifier attribute
(in FunctionInfo and MemberTypeInfo), this has been changed to AS_public
because this is the enum value that evaluates to 0.
The bitcode writer doesn't write values that are 0 so if an attribute
was set to AS_public, this value is not written and after reading the
bitcode it would have the default value which is AS_none. This is why
the default value is now AS_public.
Differential Revision: https://reviews.llvm.org/D66151
llvm-svn: 369063
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D65104
llvm-svn: 367785
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a new check to upgrade user code based on API changes in Googletest.
The check finds uses of old Googletest APIs with "case" in their name and replaces them with the new APIs named with "suite".
Patch by Alex Strelnikov (strel@google.com)
Reviewed as D62977.
llvm-svn: 367263
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Now that clang is going to be able to build the Linux kernel again on
x86, and we have gen_compile_commands.py upstream for generating
compile_commands.json, clang-tidy can be used on the Linux kernel
source.
To that end, this commit adds a new clang-tidy module to be used for
checks specific to Linux kernel source. The Linux kernel follows its own
style of C, and it will be useful to separate those checks into their
own module.
This also adds an initial check that makes sure that return values from
the kernel error functions like PTR_ERR and ERR_PTR are checked. It also
makes sure that any functions that directly return values from these
functions are checked.
Subscribers: xazax.hun, gribozavr, Eugene.Zelenko, lebedev.ri, mgorny, jdoerfert, cfe-commits
Tags: #clang, #clang-tools-extra
Reviewers: aaron.ballman, alexfh, hokein, JonasToth
Differential Revision: https://reviews.llvm.org/D59963
llvm-svn: 367071
|
|
|
|
|
|
|
|
| |
Addresses b39770.
Differential Revision: https://reviews.llvm.org/D64813
llvm-svn: 366354
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Lexer::getLocForEndOfToken is defined to return an
invalid location if the given location is inside a macro.
Other checks conditionally warn based off location
validity. Updating this check to do the same.
Reviewers: JonasToth, aaron.ballman, nickdesaulniers
Reviewed By: nickdesaulniers
Subscribers: lebedev.ri, nickdesaulniers, xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64607
llvm-svn: 366353
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
If there is no comment, place it at the closing brace of a namespace
definition. Previously it was placed at the next character after the
closing brace.
The new position produces a better location for highlighting in clangd
and does not seem to make matters worse for clang-tidy.
Reviewers: alexfh, hokein
Reviewed By: alexfh, hokein
Subscribers: xazax.hun, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64861
llvm-svn: 366337
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Finds non-static member functions that can be made ``static``.
I have run this check (repeatedly) over llvm-project. It made 1708 member functions
``static``. Out of those, I had to exclude 22 via ``NOLINT`` because their address
was taken and stored in a variable of pointer-to-member type (e.g. passed to
llvm::StringSwitch).
It also made 243 member functions ``const``. (This is currently very conservative
to have no false-positives and can hopefully be extended in the future.)
You can find the results here: https://github.com/mgehre/llvm-project/commits/static_const_eval
Reviewers: alexfh, aaron.ballman
Subscribers: mgorny, xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61749
llvm-svn: 366265
|
|
|
|
| |
llvm-svn: 365874
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
characters.
Summary:
Currently it fails on cases like '\001'.
Note: Since `StringLiteral::outputString` dumps most nonprintable
characters in octal value, the exact string literal format isn't preserved,
e.g. `"\x01"` becomes `'\001'`.
Reviewers: gribozavr
Reviewed By: gribozavr
Subscribers: lebedev.ri, Eugene.Zelenko, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64151
Patch by Xiaoyi Zhang.
llvm-svn: 365463
|
|
|
|
|
|
| |
(https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access)
llvm-svn: 365380
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Checks if any calls to posix functions (except posix_openpt) expect negative return values.
These functions return either 0 on success or an errno on failure, which is positive only.
Reviewers: JonasToth, gribozavr, alexfh, hokein
Reviewed By: gribozavr
Subscribers: Eugene.Zelenko, lebedev.ri, llozano, george.burgess.iv, xazax.hun, srhines, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63623
Patch by Jian Cai.
llvm-svn: 365007
|
|
|
|
|
|
|
|
| |
This test references a path that does not exist on Windows causing
it to emit different output from what was expected leading to a
failure when run on Windows.
llvm-svn: 364120
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: The fixit `int square(int /*num*/)` yields `error: parameter name omitted` for C code. Enable it only for C++ code.
Reviewers: klimek, ilya-biryukov, lebedev.ri, aaron.ballman
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63088
llvm-svn: 364106
|
|
|
|
|
|
|
|
|
| |
These days Python 3 is typically installed into C:/Program Files, so
cope with that.
Similar to r364077 in compiler-rt.
llvm-svn: 364087
|
|
|
|
| |
llvm-svn: 364008
|
|
|
|
|
|
|
|
| |
Fix bz#42281
Differential Revision: https://reviews.llvm.org/D63613
llvm-svn: 363975
|
|
|
|
|
|
|
| |
Apparently -Wmissing-prototypes is used for quite a few integration
tests.
llvm-svn: 363760
|
|
|
|
|
|
|
|
|
|
|
|
| |
Splits fuchsia-default-arguments check into two checks. fuchsia-default-arguments-calls warns if a function or method is called with default arguments. fuchsia-default-arguments-declarations warns if a function or method is declared with default parameters.
Committed on behalf of @diegoast (Diego Astiazarán).
Resolves b38051.
Differential Revision: https://reviews.llvm.org/D62437
llvm-svn: 363712
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: hokein, gribozavr
Reviewed By: hokein, gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63253
Patch by Johan Vikström.
llvm-svn: 363273
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixed abseil-time-subtraction to work on C++17
Reviewers: hokein, gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63261
Patch by Johan Vikström.
llvm-svn: 363272
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Made abseil-upgrade-duration-conversions tests pass on c++17
Reviewers: hokein, gribozavr
Reviewed By: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63262
Patch by Johan Vikström.
llvm-svn: 363270
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixed abseil-duration-unnecessary-conversion tests for c++17
Reviewers: hokein, gribozavr
Reviewed By: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63263
Patch by Johan Vikström.
llvm-svn: 363263
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: It was trying to pass a dependent expression into constant evaluator.
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63188
llvm-svn: 363133
|
|
|
|
|
|
| |
s/bigger then/bigger than/
llvm-svn: 363053
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixed google-readability-casting.cpp to get tests working in c++17
Reviewers: gribozavr, hokein
Reviewed By: gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63128
Patch by Shaurya Gupta.
llvm-svn: 363047
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instantiate a ClangTidyDiagnosticConsumer also for the plugin case and
let it forward the diagnostics to the external diagnostic engine that is
already in place.
One minor difference to the clang-tidy executable case is that the
compiler checks/diagnostics are referred to with their original name.
For example, for -Wunused-variable the plugin will refer to the check as
"-Wunused-variable" while the clang-tidy executable will refer to that
as "clang-diagnostic- unused-variable". This is because the compiler
diagnostics never reach ClangTidyDiagnosticConsumer.
Differential Revision: https://reviews.llvm.org/D61487
llvm-svn: 362702
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The assertion "isIntegerConstantExpr" is triggered in the
isIntegerConstantExpr(), we should not call it if the expression is value
dependent.
Reviewers: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62947
llvm-svn: 362701
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
These test cases are illgal in C++2a ("new Foo{}" needs to see the
default constructor), so move them to the C++14-only tests.
Reviewers: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62845
llvm-svn: 362679
|
|
|
|
|
|
|
|
|
|
|
| |
On Android, pipe() is better to be replaced by pipe2() with O_CLOEXEC
flag to avoid file descriptor leakage.
Patch by Jian Cai!
Differential Revision: https://reviews.llvm.org/D61967
llvm-svn: 362673
|
|
|
|
|
|
|
|
|
|
|
| |
On Android, pipe2() is better to set O_CLOEXEC flag to avoid file
descriptor leakage.
Patch by Jian Cai!
Differential Revision: https://reviews.llvm.org/D62049
llvm-svn: 362672
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, we intended to omit the check fix to the case when constructor has
any braced-init-list argument. But the HasListInitializedArgument was not
correct to handle all cases (Foo(Bar{1, 2}) will return false in C++14
mode).
This patch fixes it, corrects the tests, and makes the check to run at C++17 mode.
Reviewers: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62736
llvm-svn: 362361
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
guide.
Summary:
Revise the google-objc-global-variable-declaration check to match the style guide.
This commit updates the check as follows:
(1) Do not emit fixes for extern global constants.
(2) Allow the second character of prefixes for constants to be numeric (the new guideline is that global constants should generally be named with a prefix that begins with a capital letter followed by one or more capital letters or numbers).
https://google.github.io/styleguide/objcguide.html#prefixes
This is an amended re-submission of https://reviews.llvm.org/rG12e3726fadb0b2a4d8aeed0a2817b5159f9d029d.
Contributed By: yaqiji
Reviewers: Wizard, benhamilton, stephanemoore
Reviewed By: benhamilton, stephanemoore
Subscribers: mgorny, cfe-commits, yaqiji
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62045
llvm-svn: 362279
|
|
|
|
|
|
|
|
|
|
| |
the style guide." 💥
The change introduced new test failures.
Phabricator URL of original commit: https://reviews.llvm.org/rG12e3726fadb0b2a4d8aeed0a2817b5159f9d029d
llvm-svn: 361914
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
guide.
Summary:
Revise the google-objc-global-variable-declaration check to match the style guide.
This commit updates the check as follows:
(1) Do not emit fixes for extern global constants.
(2) Allow the second character of prefixes for constants to be numeric (the new guideline is that global constants should generally be named with a prefix that begins with a capital letter followed by one or more capital letters or numbers).
https://google.github.io/styleguide/objcguide.html#prefixes
Contributed by yaqiji.
Reviewers: Wizard, benhamilton, stephanemoore
Reviewed By: benhamilton, stephanemoore
Subscribers: mgorny, cfe-commits, yaqiji
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62045
llvm-svn: 361907
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adjusts `PragmaOpenMPHandler` to set the location of
`tok::annot_pragma_openmp` to the `#pragma` location instead of the
`omp` location so that the former becomes the start location of the
OpenMP AST node. This can be useful when, for example, rewriting a
directive using Clang's Rewrite facility. Most of this patch updates
tests for changes to locations in diagnostics and `-ast-dump` output.
Reviewed By: ABataev, lebedev.ri, Meinersbur, aaron.ballman
Differential Revision: https://reviews.llvm.org/D61509
llvm-svn: 361867
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62524
llvm-svn: 361834
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62522
llvm-svn: 361833
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
readability-identifier-naming causes a null pointer dereference when checking an identifier introduced by a structured binding whose right hand side is an undeclared identifier.
Running the check on a file that is just the following results in a crash:
```
auto [left] = right;
```
Patch by Mark Stegeman!
Reviewers: alexfh, hokein, aaron.ballman, JonasToth
Reviewed By: hokein, aaron.ballman
Subscribers: madsravn, xazax.hun, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D62404
llvm-svn: 361809
|
|
|
|
|
|
|
|
| |
Patch by Jonathan Camilleri
Differential Revision https://reviews.llvm.org/D61861
llvm-svn: 361735
|
|
|
|
|
|
|
|
|
|
| |
platforms where char is unsigned
The other options are to completely specify the triple (reduces test
coverage), or to specify a regex that allows either '0' or '0U' for char
initializers, however, that relaxes the test.
llvm-svn: 361629
|
|
|
|
|
|
| |
language modes
llvm-svn: 361628
|
|
|
|
|
|
|
|
| |
cppcoreguidelines-pro-type-member-init
Differential Revision: D24892
llvm-svn: 361601
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Added WarnOnlyIfThisHasSuspiciousField option to allow
to catch any copy assignment operator independently from
the container class's fields.
Added the cert alias using this option.
Reviewers: aaron.ballman
Reviewed By: aaron.ballman
Subscribers: mgorny, Eugene.Zelenko, xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62192
llvm-svn: 361550
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Google's Objective-C style guide forbids calling or overriding +new to instantiate objects. This check warns on violations.
Style guide reference: https://google.github.io/styleguide/objcguide.html#do-not-use-new
Patch by Michael Wyman.
Reviewers: benhamilton, aaron.ballman, JonasToth, gribozavr, ilya-biryukov, stephanemoore, mwyman
Reviewed By: aaron.ballman, gribozavr, stephanemoore, mwyman
Subscribers: stephanemoore, xazax.hun, Eugene.Zelenko, mgorny, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D61350
llvm-svn: 361487
|
|
|
|
|
|
| |
It is performing a use-of-uninitialized-value, as detected by MSan.
llvm-svn: 361163
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
I inspected every test and did one of the following:
- changed the test to run in all language modes,
- added a comment explaining why the test is only applicable in a
certain mode,
- limited the test to language modes where it passes and added a FIXME
to fix the checker or the test.
Reviewers: alexfh, lebedev.ri
Subscribers: nemanjai, kbarton, arphaman, jdoerfert, lebedev.ri, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62125
llvm-svn: 361131
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add readability-simplify-boolean-expr test cases for member variables
Fixes PR40179
Patch by LegalizeAdulthood.
Reviewers: alexfh, hokein, aaron.ballman, JonasToth
Reviewed By: JonasToth
Subscribers: jdoerfert, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D56323
llvm-svn: 360882
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with correct attribution
Summary:
modernize-loop-convert was not detecting implicit casts to
const_iterator as convertible to range-based loops:
std::vector<int> vec{1,2,3,4}
for(std::vector<int>::const_iterator i = vec.begin();
i != vec.end();
++i) { }
Thanks to Don Hinton for advice.
As well, this change adds a note for this check's applicability to code
targeting OpenMP prior version 5 as this check will continue breaking
compilation with `-fopenmp`. Thanks to Roman Lebedev for pointing this
out.
Fixes PR#35082
Patch by Torbjörn Klatt!
Reviewed By: hintonda
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D61827
llvm-svn: 360788
|