Commit Graph

59 Commits

Author SHA1 Message Date
csilvers+iwyu b1796d1b15 Add another sanity check that deals with the case iwyu
attributes a use to the wrong place (this can happen in
macros, or when iwyu is using stronger use-rules than the
language requires, like in typedefs).  We basically say: "if
foo.h includes bar.h (either directly or indirectly), and we
are thinking of suggesting that bar.h include foo.h, don't."

This covers up bugs in iwyu, but doesn't resolve them.  We
still need to introduce a concept of 'soft' use, and fix up
typedef handling, to really have 'solved' this problem.  But
this should be good enough for the fixit.

R=wan
DELTA=199  (187 added, 0 deleted, 12 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=1564
2011-04-26 22:59:48 +00:00
csilvers+iwyu ed381497a3 Add a test to protect against syntax errors in main(). Also
test some main()-invariant logic while I'm at it.

DELTA=19  (16 added, 0 deleted, 3 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=1409
2011-04-13 03:11:35 +00:00
csilvers+iwyu 37c67ac363 I was not correctly getting the location for member-exprs. I
thought I was saying the location is where the . (or ->) is,
which is what I want, but clang doesn't actually expose that.
So I have go through some hoops to try to figure it out.

We were actually seeing a problem with this when running:

blaze build --host_cpu=k8 --compile_only -k --crosstool_top=//third_party/llvm/crosstool --plugin=//devtools/maintenance/include_what_you_use:run_iwyu //gws/plugins/local/src:enhanced_listing_ad

It has 'msg_->MSG_foo' in it, where MSG_foo is a macro.  We
were attributing this use to the file defining MSG_foo, rather
than to us.  With this change, we properly attribute it to us.

R=dsturtevant
DELTA=150  (125 added, 6 deleted, 19 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=1347
2011-04-12 05:00:17 +00:00
csilvers+iwyu de5266f972 no_include pragma.
Usage: // IWYU pragma: no_include "foo/bar/baz.h"
This inhibits IWYU from suggesting that baz.h be included.

R=csilvers
DELTA=109  (98 added, 1 deleted, 10 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=1339
2011-04-12 04:56:17 +00:00
csilvers+iwyu 20b304da55 Remove an unused type+function. If only all TODOs were this easy...
R=dsturtevant
DELTA=13  (0 added, 13 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=901
2011-03-18 06:56:45 +00:00
csilvers+iwyu 09a35dd920 Support @headername pragmas. Right now the parsing is pretty primitive -
we might want to beef it up.

R=csilvers
DELTA=219  (218 added, 0 deleted, 1 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=740
2011-03-04 00:30:49 +00:00
csilvers 69d76e1239 * Rewrite iwyu_include_picker; now more pragma-friendly (csilvers)
* Add support for FakeNamedDecls for tests (dsturtevant)
	* Write our own symbol sanitizer rather than getQualified... (csilvers)
	* Change run_iwyu_tests to better fit python test framework (csilvers)
	* Revamp IWYU pragmas, now support keep + export + private (dsturtevant)
	* Fix a bug when nested classes are defined out of line (csilvers)
	* Add the ability to print an arbitrary ASTNode (csilvers)

All code by csilvers was reviewed by wan and dsturtevant.  Code by
dsturtevant was reviewed by csilvers.
2011-02-19 02:32:52 +00:00
csilvers 000a1fff6d Fixes to get code to compile under MSVC 10. Submitted by pichet2...:
http://code.google.com/p/include-what-you-use/issues/detail?id=7
with small changes by csilvers to encapsulate all arch-specific
information in one file, port.h.

Reviewed by csilvers
2011-02-08 06:12:32 +00:00
csilvers dee92b5e0a Initial release! Grains of salt not included. 2011-02-04 22:28:15 +00:00