summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Use LLVM 5.0 for clang_5.0 branchclang_5.0clang_5.0Kim Grasman2017-12-02-9/+6
| | | | | Makes sure the IWYU release branch keeps building against the right LLVM/Clang version to track any breaking changes upstream.
* Create a travis script to build with latest LLVMJ.Ru2017-10-24-0/+40
| | | | | | Concretely, it uses the latest available snapshot from apt.llvm.org Closes #293
* Always report the expanded location for a declJ.Ru2017-10-04-7/+102
| | | | | | | | | | | | 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
* Skip non-ctors during instantiation of implicit methodsJ.Ru2017-10-04-2/+67
| | | | | | | | 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
* Support 'arguments' key in compilation databasesKim Gräsman2017-09-18-6/+17
| | | | | | | 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.
* Make fix_includes.py dry-run return proper exit codeKim Gräsman2017-09-17-7/+9
| | | | | This makes the script match the documentation better, as proposed by issue #479.
* Add library dependency for backtraceKim Grasman2017-09-16-0/+3
| | | | | | | 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.
* Add -j switch to iwyu_tool.py for parallel executionPaul Seyfert2017-08-22-5/+19
| | | | | | | | 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.
* Bump version to 0.9Kim Grasman2017-08-20-1/+1
|
* Add .H as a known header extensionclang_4.0-r2Kim Grasman2017-07-15-1/+19
| | | | | | Both in IWYU and fix_includes.py. Fix issue #452.
* Commit first canonical READMEKim Grasman2017-07-09-232/+0
|
* Remove docs/InstructionsForDevelopers.mdKim Grasman2017-07-09-62/+0
| | | | | Now that /CONTRIBUTING.md exists and is linked to everywhere, this can be removed.
* Copy InstructionsForDevelopers to CONTRIBUTINGKim Grasman2017-07-04-0/+62
|
* Make fix_includes understand Windows path namesKim Grasman2017-07-04-1/+24
| | | | | This is based on a patch from @xuzhen1994, with a test case to reproduce the original problem.
* Fix requiring allocator for getting container iterator with libc++. (#448)Volodymyr Sapsai2017-07-03-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Map FILE to <stdio.h>Kim Grasman2017-07-02-0/+2
| | | | | | Newer glibc has FILE in a separate header. Fix for issue #447.
* Allow IWYU pragma: keep on forward declarations as an escape hatch for cases ↵Kristoffer Henriksson2017-06-20-22/+37
| | | | where IWYU incorrectly concludes that a forward declaration is not necessary and recommends its removal.
* Add .gitignoreKim Grasman2017-06-13-0/+2
|
* Don't lie about symbol regexes in the docsKim Grasman2017-06-13-1/+1
|
* Update to reflect changes in LLVM.Volodymyr Sapsai2017-06-08-1/+2
| | | | | LLVM r304864 extracted new library libLLVMBinaryFormat out of libLLVMSupport and libLLVMCore depends on it.
* More complete usage instructionsKim Grasman2017-06-06-5/+103
| | | | | | | Restructure to make room for more run modes Add section on new CMake support Add section on iwyu_tool.py Regenerate README
* Add test coverage for simple function pointer expressionsKim Grasman2017-05-17-2/+51
|
* Remove second-guessing for DeclRefExprs in CallExprsKim Grasman2017-05-17-9/+1
| | | | | | | | | | | | | | | 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.
* Extract function pointer tests out of badincKim Grasman2017-05-17-37/+256
|
* Equate alias declarations and typedef in templatesKim Grasman2017-05-17-1/+9
| | | | | | | | | 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.
* Break out typedef-in-template tests from badincKim Grasman2017-05-17-14/+89
| | | | | No functional change, but I discovered bug while doing this, so added a TODO.
* Accept methods hiding using declarationsKim Grasman2017-05-08-8/+33
| | | | | | | | | | | 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.
* Let scrub-logs accept input from stdinKim Grasman2017-05-06-8/+8
| | | | | | | | | | 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.
* Remove TODOed assertions fixed by upstream ClangKim Grasman2017-05-06-7/+4
| | | | | | | Clang r300938 changed CXXRecordDecl::getTemplateInstatiationPattern so a couple of unwanted assertions in badinc.cc disappeared. Remove the test expectations for these diagnostics.
* Handle locations of nested macros betterKim Grasman2017-04-18-37/+58
| | | | | | | | | | 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.
* Add pragma to set associated headerKim Grasman2017-03-10-0/+137
| | | | | | | | | 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.
* Add tweaks for declval, forward and nullptr_tEugeneZelenko2017-02-28-0/+3
|
* Pick up more sugar for function argumentsKim Grasman2017-02-21-3/+18
| | | | | | | | | | 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.
* Add optional terse flag to PrintableDeclKim Grasman2017-02-21-4/+10
| | | | Make terse printing the default.
* Exclude prefix headers from macro-defined-by-includer heuristics (issue #368).Volodymyr Sapsai2017-02-19-1/+36
| | | | | | | | | | 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
* Fix out-of-tree build for MSVCKim Grasman2017-02-19-6/+9
| | | | | | | | | | | | | | | 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.
* Remove test expectation for char_traitsKim Grasman2017-01-29-1/+1
| | | | | | 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>.
* Remove I1_Class requirement for calling operator==.Volodymyr Sapsai2017-01-28-6/+0
| | | | | | | | | | | 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
* Fix GetFirstClassArgument.Volodymyr Sapsai2017-01-28-14/+29
| | | | | | | | 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
* Relax pointer detection regexKim Grasman2017-01-25-1/+1
| | | | | | 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.
* Further improve pointer regexKim Grasman2017-01-25-1/+1
| | | | | Properly escape with r-string. Only match pointer values surrounded by word boundaries
* 64-bit addresses can be up to 16 hex digitsKim Grasman2017-01-25-1/+1
|
* Detect pointer values betterKim Grasman2017-01-25-1/+1
|
* Add dev script for log scrubbingKim Grasman2017-01-25-0/+45
|
* Add /bigobj for MSVC buildsKim Grasman2017-01-24-0/+3
| | | | | | | We enabled extended object format to work around 'too many sections' for MinGW, but not for MSVC. Do so now.
* How to Run: Redirect stderr to /tmp/iwyu.outWieland Hoffmann2017-01-22-3/+3
| | | | | 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 (#388)Kim Gräsman2017-01-10-0/+6
| | | | | | | | | | | | 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.
* Update to reflect changes in ClangKim Grasman2017-01-06-2/+2
| | | | r291184 switched the CompilerInvocation argument to a shared_ptr.
* Remove incorrect test case assumption on desugared typesKim Grasman2017-01-06-2/+0
| | | | | | | | | | 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.
* Handle CK_ZeroToOCLQueue cast kindKim Grasman2017-01-01-0/+1
| | | | Added in Clang in r290431, and handled here to silence warning.