| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
| |
Makes sure the IWYU release branch keeps building against the right
LLVM/Clang version to track any breaking changes upstream.
|
|
|
|
|
|
| |
Concretely, it uses the latest available snapshot from apt.llvm.org
Closes #293
|
|
|
|
|
|
|
|
|
|
|
|
| |
In cases where a declaration is generated using a macro, iwyu was
incorrectly suggesting to include the file that defined such macro
instead of the actual location where it was ultimately expanded.
When reporting the declaration for a use, make sure to always refer
to the expansion/instantiation of such declaration. Whether or not
it was part of a macro expansion should be irrelevant for the use.
Fixes #282
|
|
|
|
|
|
|
|
| |
InstantiateImplicitMethods() wrongly assumed a ctor decl must be
present just by checking that it is not a template decl. This is
no longer true in C++11 where a using decl is also a valid ctor type.
Fixes #402
|
|
|
|
|
|
|
| |
Move things around a little to make this easier to implement -- run_iwyu
now translates from a compilation database entry to a command-line.
This should fix issue #456.
|
|
|
|
|
| |
This makes the script match the documentation better, as proposed by
issue #479.
|
|
|
|
|
|
|
| |
The out-of-tree build on my FreeBSD 11 machine failed with an unresolved
symbol for `backtrace`.
Use CMake's find provider for backtrace to satisfy the dependency.
|
|
|
|
|
|
|
|
| |
Use Python's multiprocessing to run source files in parallel. Default number of
jobs is 1, so no functional change by default.
Minor bug (missing comma in argument parser) fixed and squashed by Kim
Grasman. This is the equivalent of PR #444.
|
| |
|
|
|
|
|
|
| |
Both in IWYU and fix_includes.py.
Fix issue #452.
|
| |
|
|
|
|
|
| |
Now that /CONTRIBUTING.md exists and is linked to everywhere, this can be
removed.
|
| |
|
|
|
|
|
| |
This is based on a patch from @xuzhen1994, with a test case to reproduce
the original problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libc++ code is
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::begin() _NOEXCEPT
{
return __make_iter(this->__begin_);
}
and we reported use of allocator when visiting `vector<_Tp, _Allocator>`
because here `_Allocator` is not a default template argument. There was
no such problem in libstdc++ because there `begin` is defined inside a class.
Also I wasn't able to reproduce the issue with non-STL types because for
not precomputed types we replayed template arguments usage. And when we
populate the cache we see which template arguments are default so there
are no problems during replay.
Update test to remove method calls using object template arguments. As result,
on macOS it fixed errors
tests/cxx/badinc.cc:1534: Unexpected diagnostic:
I2_Enum is defined in "tests/cxx/badinc-i2.h", which isn't directly #included.
tests/cxx/badinc.cc:1580: Unexpected diagnostic:
I2_Enum is defined in "tests/cxx/badinc-i2.h", which isn't directly #included.
but introduced another error
tests/cxx/badinc.cc:1527: Unmatched regex:
I2_Enum is...*badinc-i2.h
I think it's a reasonable trade-off.
|
|
|
|
|
|
| |
Newer glibc has FILE in a separate header.
Fix for issue #447.
|
|
|
|
| |
where IWYU incorrectly concludes that a forward declaration is not necessary and recommends its removal.
|
| |
|
| |
|
|
|
|
|
| |
LLVM r304864 extracted new library libLLVMBinaryFormat out of
libLLVMSupport and libLLVMCore depends on it.
|
|
|
|
|
|
|
| |
Restructure to make room for more run modes
Add section on new CMake support
Add section on iwyu_tool.py
Regenerate README
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In TraverseDeclRefExpr we would exit early if we were under a
CallExpr, with the motivation that CallExpr had already handled the
relevant cases.
However, VisitCallExpr only looks specifically for reference arguments
passed to vararg functions, and ignores everything else.
Let TraverseDeclRefExpr work on all expressions, so that creating
function pointers to templates works in all contexts, including
CallExprs.
Fixes issue #425.
|
| |
|
|
|
|
|
|
|
|
|
| |
Typedefs are exempted from IWYU checks in templates, so treat C++11
alias declarations the same.
(side note: this behavior is broken, but at least now it's consistent)
Fixes issue #412.
|
|
|
|
|
| |
No functional change, but I discovered bug while doing this,
so added a TODO.
|
|
|
|
|
|
|
|
|
|
|
| |
When a method in a derived class hides a name introduced by a
using-declaration, Clang discards the using shadow declarations for the
hidden name.
We used to have an assertion that every using-declaration must have a
shadow declaration. This patch removes it, to placate the above.
Fixes issue #420.
|
|
|
|
|
|
|
|
|
|
| |
Use the fileinput module to take input from stdin or a named file.
This enables:
$ include-what-you-use -Xiwyu -v7 file.cc 2>&1 | ./scrub-logs.py
which is very useful for comparing execution flows.
|
|
|
|
|
|
|
| |
Clang r300938 changed CXXRecordDecl::getTemplateInstatiationPattern so a
couple of unwanted assertions in badinc.cc disappeared.
Remove the test expectations for these diagnostics.
|
|
|
|
|
|
|
|
|
|
| |
We've seen that IWYU completely misses the mark when finding the use location
for htons from inet.h.
This patch should handle nested macros better. Test case based on htons added to
macro_location.cc
Fix #334 and #358.
|
|
|
|
|
|
|
|
|
| |
Sometimes IWYU's auto-detection of associated headers is insufficient.
Add an IWYU pragma to explicitly set associated header.
This is based on an original patch by Ivan Koster.
I added a test and some documentation.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Type sugar (typedefs, more specifically) were previously lost for
arguments passed by value.
Introduce a new helper function to glean sugared type info from
ImplicitCastExpr nodes in the AST, as present in later revs of Clang.
Fixes a TODO in derived_function_tpl_args.
|
|
|
|
| |
Make terse printing the default.
|
|
|
|
|
|
|
|
|
|
| |
Also considered options of not populating `macro_users_` or
`direct_includes_as_fileentries_` for prefix headers but decided not to
do so. I think it is better to have correct information for prefix
headers but not to give recommendations based on that instead of having
incomplete information.
PR https://github.com/include-what-you-use/include-what-you-use/pull/410
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't build with MSVC out-of-tree regularly, so a number of
compatibility issues with LLVM had snuck in:
- Suppressed warnings in header LLVM files
- Extended object format support (/bigobj)
- Use of noexcept requires sane C++ exception semantics (/EHSc)
- Clang's MSVCToolChain.cpp now uses functions from version.dll, so add it
to linker deps
While dabbling with this, we also found it was necessary to CMake with
-DCMAKE_BUILD_TYPE=Release to match LLVM's release-built libraries.
Mention this in the user docs.
|
|
|
|
|
|
| |
Clang no longer desugars as aggressively. As a consequence, char_traits no
longer 'leaks' through the definition of std::string and is not noted in
the why-comment for <string>.
|
|
|
|
|
|
|
|
|
|
|
| |
operator== calls I1_const_ptr<T>::operator* and after Clang r289250 we
correctly detect that the return type of
const T& operator*() { return *ptr_; }
is LValueReferenceType and doesn't require full type use.
PR https://github.com/include-what-you-use/include-what-you-use/pull/399
|
|
|
|
|
|
|
|
| |
Check function parameters types instead of types of arguments at call
site. This way we are able to detect template substitutions for the
function itself, not for the caller.
PR https://github.com/include-what-you-use/include-what-you-use/pull/399
|
|
|
|
|
|
| |
Clang sometimes forgets to put in a space between pointer values and the
trailing identifier (`nullptr`), so remove the trailing word boundary
requirement from pointer detection.
|
|
|
|
|
| |
Properly escape with r-string.
Only match pointer values surrounded by word boundaries
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
We enabled extended object format to work around 'too many sections' for
MinGW, but not for MSVC.
Do so now.
|
|
|
|
|
| |
The messages from include-what-you-use are printed on stderr, so redirect that
to the log file.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adjust badinc test for improved Clang behavior
badinc.cc would have several intentional misattributions for iterators to
<vector>. Clang changed in r289250 to better preserve type sugar, which caused
these tests to produce more correct diagnostics. Test assertions were now
protecting broken behavior, and failing.
Adjust assertions to reflect goodness.
Add one test case for yoda-style iterator comparison.
|
|
|
|
| |
r291184 switched the CompilerInvocation argument to a shared_ptr.
|
|
|
|
|
|
|
|
|
|
| |
Clang r289250 caused more type sugar to remain in the AST. That, in turn, caused
derived_function_tpl_args to fail, because we had a compensating assertion
(marked with a TODO indicating that it was undesirable.)
Now that type sugar survives, we won't see a need for IndirectClass
here. Rather, the use will be attributed to the LocalClass typedef, which exists
in the same file. No diagnostic expected.
|
|
|
|
| |
Added in Clang in r290431, and handled here to silence warning.
|