| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The others are all in imperative mood.
|
| |
|
| |
|
|
|
|
| |
Based on excellent input from @zchrissirhcz in issue #975.
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Don't require aliased type method callability if explicitly forward-
declared according to the IWYU forward declaration policy
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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"'
|
|
|
|
|
| |
TypedefDecl replaced by TypedefNameDecl (common base class for TypedefDecl and TypeAliasDecl)
where possible
|
|
|
|
| |
set_in_forward_declare_context should be called in VisitTypedefDecl anyway when it matters
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Use <time.h> as the primary header for portability to non-POSIX systems.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|