Commit Graph

9 Commits

Author SHA1 Message Date
Kim Gräsman bd305afe7d Support 'IWYU pragma: export' for forward declarations
Covers both begin_export/end_export blocks and single-line export
pragmas.

Like with 'IWYU pragma: keep' marks the forward decl as automatically
desired to avoid removing manually exported but unused decls.

Add a simple testcase and update documentation.
2023-01-22 20:32:32 +01:00
Daniel Hannon cf1624a4e2 Add begin_keep and end_keep pragmas, test and docs
this was a proposed issue in #1095 where one could
make a block of keeps as opposed to marking every
keep with a pragma: keep instruction.

added test to verify and updated documentation
where appropriate.
2022-11-02 19:33:10 +01:00
Kim Gräsman cf53880822 Add --regex option
As reported in issue #981, using std::regex in IWYU has caused a
tremendous performance regression for large mapping files containing
regex mappings.

  $ cat t.cc
  #include <string>

  # with llvm::Regex
  $ time include-what-you-use -Xiwyu --mapping_file=qt5_11.imp t.cc
  ...
  real 0m0,529s
  user 0m0,509s
  sys  0m0,020s

  # with std::regex
  $ time include-what-you-use -Xiwyu --mapping_file=qt5_11.imp t.cc
  ...
  real 0m29,870s
  user 0m29,717s
  sys  0m0,012s

qt5_11.imp contains 2300+ regex mappings, and <string> has a bunch of
includes, so this is a good testbed for regular expression engines, but
over 50x slower is not the result we were hoping for.

The reason we switched to std::regex was to get support for negative
lookaround (llvm::Regex does not have it), but exotic regexes in
mappings are pretty rare, and this is a significant performance hit.

Introduce a --regex option to select regex dialect, with documented
tradeoffs. Put the default back to LLVM's fast implementation.

This fixes issue #981.
2022-09-03 15:04:27 +02:00
Daniel Hannon 3f456f66c2 add --comment_style option with tests 2022-05-28 11:03:47 +02:00
Daniel Hannon 67942da411 clarify purpose of --update_comments in help screen and manpages 2022-05-28 11:03:40 +02:00
Aaron Puchert 5f38c0dd36 Minor improvements to man page formatting
In [=N] only N is a non-terminal, the = is a terminal and [] is neither.
When referring to another man page, only the name should be bold, not
the number in parentheses.

For referring to the example we don't need special fonts. The order and
naming of sections in a man page is standardized and examples are always
under this heading towards the end.
2022-05-27 14:57:31 +02:00
Kim Gräsman 383a9afb9e Update documentation for new exit codes
Some creative writing in both README and manpage.
2022-02-26 12:21:26 +01:00
Kim Gräsman 7008f86fb4 Fix coding system for manpage
Emacs complains about uppercase "UTF-8".
2022-02-25 23:06:23 +01:00
Aaron Puchert 596f993624 Add man page as a brief reference documentation
The manual page is compiled from the builtin help and the extensive
documentation, condensed down to the essence. We leave details and
elaborated examples to the Markdown documentation.
2019-11-03 16:06:30 +01:00