Commit Graph

15 Commits

Author SHA1 Message Date
Kim Gräsman 7ca0a75b85 [clang compat] Harden handling of 'final' specifier
Clang 9f57b65a272817752aa00e2fb94154e6eed1d0ec sometimes prints the 'final'
keyword twice for a declaration (tracking bug:
https://github.com/llvm/llvm-project/issues/56517).

This triggered several bugs in MungedForwardDeclareLineForTemplates:

* Only removed first 'final'
* Removed one character too many (sizeof(char[]) includes the trailing NUL)

Instead, replace all occurrences of 'final' and do it first so the stripping of
superclasses and body also get rid of trailing spaces. This should now work even
if the upstream bug is fixed.
2022-07-16 15:43:31 +02:00
Kim Grasman 7c2ec8f05b Rename port.h -> iwyu_port.h 2019-12-26 16:12:02 +01:00
EugeneZelenko e05d81f32d Fix some Clang-tidy warnings
NULL/0 -> nullptr
C standard library include -> C++ counterparts
Occasional use of auto
Explicit strcmp return value check
Remove unused usings
Closing comments for anonymous namespaces
2016-06-07 21:49:33 +02:00
Kim Grasman e58967a2ec Make header guards consistent
- Remove DEVTOOLS_MAINTENANCE_ from header guards, that was a
  now-unnecessary Googleism

- Fix header guard to match filename in all production code

- Fix header guard to match path in all tests
2016-05-25 22:17:31 +02:00
Kim Grasman aab335418d Address review comments.
- Rename Truncate -> Ellipsize
- Spare a char for newline in max_length
- Better truncation rules so we don't get nonsense comments like '//  f...',
  '// for T...', etc. We now require that we have room for at least three
  chars from the symbol in order to include it, and the prefix is not
  included in the truncation.
2015-08-05 12:14:52 +02:00
Kim Grasman b15b7a4b4a Fix issue 163: briefer why comments.
Instead of reserving the last 5 chars for ', etc' in why comments, just
truncate the last symbol with '...'. This generally gives more relevant
output.
2015-08-04 13:01:23 +02:00
csilvers+iwyu 3d55404056 Include-what-you-use fixes by running it on itself.
R=dsturtevant,csilvers
	DELTA=215  (135 added, 45 deleted, 35 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=1731
2011-05-04 18:29:59 +00:00
csilvers+iwyu 20499967c7 Allow // comments at the end of pragma statements.
R=csilvers
DELTA=201  (183 added, 0 deleted, 18 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=1586
2011-04-26 23:10:06 +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 ff58741b91 Avoid signed/unsigned comparison warnings.
R=wan
DELTA=5  (1 added, 0 deleted, 4 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=746
2011-03-04 01:49:41 +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+iwyu 97d04c4a90 Replace assert() by CHECK_, which is always executed, even in
opt mode.

R=wan
DELTA=131  (16 added, 15 deleted, 100 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=738
2011-03-04 00:29:56 +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