summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* [ci] Fix YAML syntaxscheduled-ciKim Gräsman2022-01-09-3/+3
| | | | | | | In the previous commit, I merged overlooking the fact that it didn't work. Apparently push and pull_request can be combined with schedule if they're all dict forms; the former two can have empty values.
* [ci] Schedule nightly buildKim Gräsman2022-01-09-0/+3
| | | | | | | | This will make it easier for us to detect when IWYU breaks due to upstream Clang changes. The default behavior for 'schedule' is to run the build for the default branch, so it only applies to our master branch.
* [ci] Fix phrasing in commentKim Gräsman2022-01-09-1/+1
| | | | The others are all in imperative mood.
* Bump version to 0.18 on masterKim Gräsman2021-12-05-1/+1
|
* Update README for 0.17Kim Gräsman2021-12-05-0/+1
|
* Clarify usage instructions for CMake integrationKim Gräsman2021-12-05-2/+6
| | | | Based on excellent input from @zchrissirhcz in issue #975.
* Add mappings for the macro 'SIGCHLD'Alejandro Colomar2021-12-05-0/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for the macro 'MAP_STACK'Alejandro Colomar2021-12-05-0/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for (struct) 'stat'Alejandro Colomar2021-12-05-0/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add export from <stdint.h> to <inttypes.h>Omar Sandoval2021-12-04-25/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IWYU currently warns for this example: $ cat test.c #include <inttypes.h> #include <stdio.h> int main(void) { uint64_t x = UINT64_C(1234); printf("%" PRIu64 "\n", x); return 0; } $ include-what-you-use test.c test.c should add these lines: #include <stdint.h> // for UINT64_C, uint64_t test.c should remove these lines: The full include-list for test.c: #include <inttypes.h> // for PRIu64 #include <stdint.h> // for UINT64_C, uint64_t #include <stdio.h> // for printf --- However, the C standard states that "the header <inttypes.h> includes the header <stdint.h>". So, this program shouldn't need to include <stdint.h>. Some mappings were previously added for individual symbols from <stdint.h> (e.g., commit 24f9fdf0af94 ("Add more mappings for [u]intptr_t"), but it's more accurate to export everything. Get rid of the symbol mappings and add an include mapping.
* Work around missing llvm-omp-device-info in Debian packagingKim Gräsman2021-12-04-0/+1
|
* Don't require aliased type method callabilityBolshakov2021-10-03-1/+65
| | | | | Don't require aliased type method callability if explicitly forward- declared according to the IWYU forward declaration policy
* Add `--update_comments` optionSalman Javed2021-10-01-6/+99
| | | | | | | | | Fixes #75 and fixes #494. Add `--update_comments` option to make IWYU always print the 'why' #include comments, regardless of whether any include lines need to be added or removed. With this change, IWYU will update the "// for xyz" comments as the code changes, preventing the comments from becoming stale.
* Always use one-line messages with --output-format=clangSven Panne2021-09-26-5/+9
| | | | | | | | | | | | | | | | | | | | | | Apart from being easier to read by humans, this improves the cooperation with other tools (e.g. Jenkins' warnings-ng plugin, various Emacs modes) quite a bit. As an example, here the previous output: Foo.h:1:1: error: add the following line class Bar; Foo.h:18:1: error: remove the following line #include "Bar.h" Foo.cc:1:1: error: add the following line #include "Baz.h" // for Huey, Dewey, Louie (ptr only) Foo.cc:19:1: error: remove the following line #include "Blah.h" With this patch: Foo.h:1:1: error: add 'class Bar;' Foo.h:18:1: error: superfluous '#include "Bar.h"' Foo.cc:1:1: error: add '#include "Baz.h"' (for Huey, Dewey, Louie (ptr only)) Foo.cc:19:1: error: superfluous '#include "Blah.h"'
* C++11 type aliases should be treated similar to typedefsBolshakov2021-08-10-11/+136
| | | | | TypedefDecl replaced by TypedefNameDecl (common base class for TypedefDecl and TypeAliasDecl) where possible
* Maintenance: seemingly useless code removedBolshakov2021-08-10-3/+0
| | | | set_in_forward_declare_context should be called in VisitTypedefDecl anyway when it matters
* Add workaround for broken packagingKim Gräsman2021-08-06-0/+4
| | | | | | | libclang-NN.so recently changed versioning schemes, and it doesn't look like the Debian packages have caught up. We don't use this file, so placate CMake by creating an empty placeholder.
* Use [[noreturn]] instead of LLVM_ATTRIBUTE_NORETURNKim Gräsman2021-08-06-1/+1
| | | | | | A recent change to LLVM removed LLVM_ATTRIBUTE_NORETURN in favor of plain C++11 [[noreturn]]. Since we require C++14 to build these days, just assume that the [[noreturn]] attribute is available.
* Use std::regex instead of llvm::RegexKim Gräsman2021-08-04-5/+6
| | | | | | | | | | | | llvm::Regex does not support negative lookaround, so there was no way to do negative assertions such as: "@\"((?!.*/internal/).*)-inl.h\"" as part of mapping rules. Switch to std::regex (which defaults to ECMAScript regex dialect) to allow these constructs.
* Link with all target librariesKim Gräsman2021-07-25-3/+3
| | | | | | | | | | | | | In the parent commit, I forgot to update the build so that include-what-you-use links with all targets, which led to link failures for builds against LLVM build trees (as opposed to the Debian packages). While troubleshooting this, I found a patch by @Romain-Geissler-1A that I had previously misunderstood/overlooked: https://github.com/include-what-you-use/include-what-you-use/pull/854#issuecomment-732487734 Borrowing the link dependencies from that patch to complete my accidental plagiarism fixes the build again.
* Initialize all LLVM targets on startupKim Gräsman2021-07-21-7/+5
| | | | | | | | | | | | | | | It used to be the case that the MS inline assembly parser in Clang crashed if an X86 target was not registered and initialized. The error handling there has been improved, so now Clang complains and says it needs X86 target support to continue, and raises an error. That's good news for IWYU, as the majority of code we analyze has no MS inline assembly (fingers crossed!). So instead of requiring an X86 target to be included, initialize _all_ registered LLVM targets and assume that X86 is available in any configuration intended for use with MS inline assembly. This makes it possible to build a fully non-X86 toolchain including IWYU.
* Use primary function template declaration for macro author intentKim Gräsman2021-07-21-2/+138
| | | | | | | | | | | | We already have a rule that if a decl is used entirely inside a macro, and it's forward-declared in the macro file, the use is attributed to the expansion location. This, however, did not cover template specializations, as described in issue 847. So now we treat a primary function template declaration in the macro file as a regular forward-declaration, which means that function template specializations used in macros will be attributed to the expansion location iff the primary template has a declaration in the macro file.
* Support class template argument deductionKim Gräsman2021-07-21-5/+72
| | | | | | | | | | | | | CTAD is a C++17 feature that allows template arguments to be deduced from constructor expressions. For example: A a(10, 20); is shorthand for: A<int, int> a(10, 20); This should fix issue #826.
* Add more mappings for 'va_list'Alejandro Colomar2021-07-11-4/+8
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'uintmax_t'Alejandro Colomar2021-07-11-0/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Reorder (alphabetically) mappings for 'uid_t'Alejandro Colomar2021-07-11-2/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for (struct) 'timeval'Alejandro Colomar2021-07-11-0/+6
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for (struct) 'timespec'Alejandro Colomar2021-07-11-0/+12
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'timer_t'Alejandro Colomar2021-07-11-0/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for 'time_t'Alejandro Colomar2021-07-11-2/+18
| | | | | | Use <time.h> as the primary header for portability to non-POSIX systems. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Reorder (alphabetically) mappings for 'suseconds_t'Alejandro Colomar2021-07-11-2/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for 'ssize_t'Alejandro Colomar2021-07-11-2/+12
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Fix mappings for 'socklen_t'Alejandro Colomar2021-07-11-6/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'struct sockaddr'Alejandro Colomar2021-07-11-0/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for 'size_t'Alejandro Colomar2021-07-11-2/+42
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'union sigval'Alejandro Colomar2021-07-11-0/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Fix mappings for 'sigset_t'Alejandro Colomar2021-07-11-2/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'siginfo_t'Alejandro Colomar2021-07-11-0/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'struct sigevent'Alejandro Colomar2021-07-11-0/+8
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'regoff_t'Alejandro Colomar2021-07-11-0/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'regmatch_t'Alejandro Colomar2021-07-11-0/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'regex_t'Alejandro Colomar2021-07-11-0/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for 'pid_t'Alejandro Colomar2021-07-11-2/+12
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for 'off_t'Alejandro Colomar2021-07-11-4/+10
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for 'mode_t'Alejandro Colomar2021-07-11-2/+8
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for [l]ldiv_tAlejandro Colomar2021-07-11-0/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add mappings for 'struct lconv'Alejandro Colomar2021-07-11-0/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Remove incorrect mapping for 'intptr_t'Alejandro Colomar2021-07-11-2/+0
| | | | | | | If a library defines intptr_t in <unistd.h> that's a bug. It shall only be defined in <stdint.h> and <inttypes.h>. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for [u]intptr_tAlejandro Colomar2021-07-11-0/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Add more mappings for [u]intN_t typesAlejandro Colomar2021-07-11-0/+16
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>