Commit Graph

626 Commits

Author SHA1 Message Date
Adrian Prantl 9fc8faf9e6 Remove \brief commands from doxygen comments.
This is similar to the LLVM change https://reviews.llvm.org/D46290.

We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done

Differential Revision: https://reviews.llvm.org/D46320

llvm-svn: 331834
2018-05-09 01:00:01 +00:00
Richard Smith b5f8171a1b PR37189 Fix incorrect end source location and spelling for a split '>>' token.
When a '>>' token is split into two '>' tokens (in C++11 onwards), or (as an
extension) when we do the same for other tokens starting with a '>', we can't
just use a location pointing to the first '>' as the location of the split
token, because that would result in our miscomputing the length and spelling
for the token. As a consequence, for example, a refactoring replacing 'A<X>'
with something else would sometimes replace one character too many, and
similarly diagnostics highlighting a template-id source range would highlight
one character too many.

Fix this by creating an expansion range covering the first character of the
'>>' token, whose spelling is '>'. For this to work, we generalize the
expansion range of a macro FileID to be either a token range (the common case)
or a character range (used in this new case).

llvm-svn: 331155
2018-04-30 05:25:48 +00:00
Eugene Zelenko db914a46da [Edit, Rewrite] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 328597
2018-03-27 00:01:49 +00:00
George Karpenkov 4a190fe62f [analyzer] Show full analyzer invocation for reproducibility in HTML reports
Analyzing problems which appear in scan-build results can be very
difficult, as after the launch no exact invocation is stored, and it's
super-hard to launch the debugger.
With this patch, the exact analyzer invocation appears in the footer,
and can be copied to debug/check reproducibility/etc.

rdar://35980230

llvm-svn: 323245
2018-01-23 19:28:52 +00:00
George Karpenkov 7c540debf2 [html] [NFC] Use raw strings to dump the style table.
llvm-svn: 323244
2018-01-23 19:28:43 +00:00
George Karpenkov 6d83f34afd [analyzer] Better UI in html reports for displaying shortcuts help
Make the help window accessible, but don't show by default.
Use a different CSS class from macro.

llvm-svn: 322750
2018-01-17 20:06:26 +00:00
George Karpenkov a5ddd3cacb [analyzer] support a mode to only show relevant lines in HTML diagnostics
HTML diagnostics can be an overwhelming blob of pages of code.
This patch adds a checkbox which filters this list down to only the
lines *relevant* to the counterexample by e.g. skipping branches which
analyzer has assumed to be infeasible at a time.

The resulting amount of output is much smaller, and often fits on one
screen, and also provides a much more readable diagnostics.

Differential Revision: https://reviews.llvm.org/D41378

llvm-svn: 322612
2018-01-17 02:59:11 +00:00
George Karpenkov 151407c35b [analyzer] Add Javascript to analyzer HTML output to allow keyboard navigation.
Differential Revision: https://reviews.llvm.org/D41414

llvm-svn: 321320
2017-12-21 22:57:51 +00:00
Devin Coughlin f0cadcd9f3 [Analyzer] Add support for displaying cross-file diagnostic paths in HTML output
This change adds support for cross-file diagnostic paths in html output. If the
diagnostic path is not cross-file, there is no change in the output.

Patch by Vlad Tsyrklevich!

Differential Revision: https://reviews.llvm.org/D30406

llvm-svn: 309968
2017-08-03 18:12:22 +00:00
Galina Kistanova 4c7705c849 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304647
2017-06-03 06:29:40 +00:00
Artem Dergachev b1991c5fa7 [analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last)
The problem that caused the msvc crash has been indentified and fixed
in the previous commit. This patch contains the rest of r283092.

llvm-svn: 283584
2016-10-07 19:25:10 +00:00
Artem Dergachev 5d9278ef00 Revert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"
Vector of smart pointers wasn't the thing that caused msvc crash.

llvm-svn: 283537
2016-10-07 10:56:44 +00:00
Artem Dergachev fc36b586fb [analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"
Replace SmallVector<IntrusiveRefCntPtr> with a vector of plain pointers.
Would insignificantly increase memory usage.

llvm-svn: 283536
2016-10-07 10:44:09 +00:00
Vitaly Buka 20efb97ff3 Revert "[analyzer] Extend bug reports with extra notes" to fix Windows bot.
This reverts commit r283092.

llvm-svn: 283180
2016-10-04 02:19:17 +00:00
Artem Dergachev 9dceb11b2f [analyzer] Extend bug reports with extra notes
These diagnostics are separate from the path-sensitive engine's path notes,
and can be added manually on top of path-sensitive or path-insensitive reports.

The new note diagnostics would appear as note:-diagnostic on console and
as blue bubbles in scan-build. In plist files they currently do not appear,
because format needs to be discussed with plist file users.

The analyzer option "-analyzer-config notes-as-events=true" would convert
notes to normal path notes, and put them at the beginning of the path.
This is a temporary hack to show the new notes in plist files.

A few checkers would be updated in subsequent commits,
including tests for this new feature.

Differential Revision: https://reviews.llvm.org/D24278

llvm-svn: 283092
2016-10-03 07:58:26 +00:00
Mehdi Amini 99d1b29503 Use StringRef for MemoryBuffer identifier API (NFC)
llvm-svn: 283043
2016-10-01 16:38:28 +00:00
Artem Dergachev 6cc33b2239 [analyzer] Fix HTMLRewriter style sheets to support non-webkit browsers.
This fixes rounded corners and shadows of analyzer diagnostic pieces
in browsers such as Firefox.

Differential Revision: https://reviews.llvm.org/D23272

llvm-svn: 281625
2016-09-15 16:25:42 +00:00
Richard Trieu cc3949d99a Remove use of builtin comma operator.
Cleanup for upcoming Clang warning -Wcomma.  No functionality change intended.

llvm-svn: 261271
2016-02-18 22:34:54 +00:00
David Blaikie 2eabcc988f Simplify EnterTokenStream API to make it more robust for memory management
While this won't help fix things like the bug that r260219 addressed, it
seems like good tidy up to have anyway.

(it might be nice if "makeArrayRef" always produced a MutableArrayRef &
let it decay to an ArrayRef when needed - then I'd use that for the
MutableArrayRefs in this patch)

If we had std::dynarray I'd use that instead of unique_ptr+size_t,
ideally (but then it'd have to be threaded down through the Preprocessor
all the way - no idea how painful that would be)

llvm-svn: 260246
2016-02-09 18:52:09 +00:00
Chris Bieneman 2bf68c6c1c Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

    "This is the way [autoconf] ends
    Not with a bang but a whimper."
    -T.S. Eliot

Reviewers: chandlerc, grosbach, bob.wilson, echristo

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D16472

llvm-svn: 258862
2016-01-26 21:30:40 +00:00
Angel Garcia Gomez 637d1e6694 Roll-back r250822.
Summary: It breaks the build for the ASTMatchers

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D13893

llvm-svn: 250827
2015-10-20 13:23:58 +00:00
Angel Garcia Gomez b5250d3448 Apply modernize-use-default to clang.
Summary: Replace empty bodies of default constructors and destructors with '= default'.

Reviewers: bkramer, klimek

Subscribers: klimek, alexfh, cfe-commits

Differential Revision: http://reviews.llvm.org/D13890

llvm-svn: 250822
2015-10-20 12:52:55 +00:00
Yaron Keren 70bd288534 Make local function isWhitespaceExceptNL static instead of in anonymous namespace
per the coding standard. Thanks Craig Tooper for noticing this.

llvm-svn: 243381
2015-07-28 04:54:03 +00:00
Yaron Keren a96ffd5337 Rename highly-confusing isWhitespace that returns false on \n to
isWhitespaceExceptNL. If that's wasn't bad enough, we have an identically 
named function in Basic/CharInfo.h.

While at it, remove unnecessary includes, .str() calls and #ifdef.

llvm-svn: 243260
2015-07-27 06:35:22 +00:00
Alexander Kornienko ab9db51042 Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").
llvm-svn: 240353
2015-06-22 23:07:51 +00:00
Alexander Kornienko 3d9d929e42 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

  $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
      -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
      work/llvm/tools/clang

To reduce churn, not touching namespaces spanning less than 10 lines.

llvm-svn: 240270
2015-06-22 09:47:44 +00:00
Benjamin Kramer 8017237277 Remove empty non-virtual destructors or mark them =default when non-public
These add no value but can make a class non-trivially copyable. NFC.

llvm-svn: 234689
2015-04-11 15:58:30 +00:00
Argyrios Kyrtzidis 69e6f1f257 [Rewrite] Make RewriteBuffer accessible on its own, and add a unit test for it.
llvm-svn: 231588
2015-03-08 04:00:33 +00:00
Hans Wennborg aa244c4cc4 Trim some includes. NFC.
llvm-svn: 220877
2014-10-29 22:13:46 +00:00
Daniel Jasper 09c7c93937 Delete unused method and clangAST dependency it required.
llvm-svn: 220640
2014-10-26 14:26:55 +00:00
NAKAMURA Takumi 3866e52803 [CMake] clangRewrite: Roll back clangAST in libdeps, due to clang::Stmt::printPretty().
llvm-svn: 220549
2014-10-24 08:44:01 +00:00
Daniel Jasper 4475a249e7 Remove code duplication and cut dependency from clangRewrite on
clangAST.

llvm-svn: 220502
2014-10-23 19:47:36 +00:00
Benjamin Kramer fdacdb26af Use intrusive refcounted pointers to manage RopeRefCountString lifetime.
std::shared_ptr<char []> would be even nicer, but shared_ptr doesn't work
with arrays :(

No functionality change.

llvm-svn: 217798
2014-09-15 17:58:03 +00:00
Alp Toker 0621cb2e7d Make clang's rewrite engine a core feature
The rewrite facility's footprint is small so it's not worth going to these
lengths to support disabling at configure time, particularly since key compiler
features now depend on it.

Meanwhile the Objective-C rewriters have been moved under the
ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still
potentially worth excluding from lightweight builds.

Tests are now passing with any combination of feature flags. The flags
historically haven't been tested by LLVM's build servers so caveat emptor.

llvm-svn: 213171
2014-07-16 16:48:33 +00:00
Rafael Espindola c080917ec2 Replace llvm::error_code with std::error_code.
llvm-svn: 210780
2014-06-12 14:02:15 +00:00
Richard Trieu ddd01cec0e Removing an "if (this == nullptr)" check from two print methods. The condition
will never be true in a well-defined context.  The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.

llvm-svn: 210498
2014-06-09 22:53:25 +00:00
Alp Toker 1d257e1d0a Remove the last remaining llvm/Config/config.h includes
This corrects long-standing misuses of LLVM's internal config.h.

In most cases the public llvm-config.h header was intended and we can now
remove the old hacks thanks to LLVM r210144.

The config.h header is private, won't be installed and should no longer be
included by clang or other modules.

llvm-svn: 210145
2014-06-04 03:28:55 +00:00
Craig Topper 8ae1203992 [C++11] Use 'nullptr'.
llvm-svn: 208163
2014-05-07 06:21:57 +00:00
Lubos Lunak 4526b46ee6 write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

llvm-svn: 207795
2014-05-01 21:11:57 +00:00
Lubos Lunak 72cad68b30 do not use "1" for line marker for the predefines "file" either
Similar to r207764.

llvm-svn: 207794
2014-05-01 21:10:08 +00:00
Lubos Lunak 10961c0eab do not use "1" for line marker for the main file
"1" means entering a new file (from a different one), but the main
file is not included from anything (and this would e.g. confuse -Wunused-macros
to not report unused macros in the main file, see pr15610, or also see pr18948).
The line marker is still useful e.g. if the resulting file is renamed or used
via a pipe.

llvm-svn: 207764
2014-05-01 13:50:44 +00:00
Lubos Lunak 64568ca18a revert r207756
There's nothing wrong with the change itself, but
test/Frontend/rewrite-includes-messages.c fails without another
not-yet-committed fix.

llvm-svn: 207762
2014-05-01 13:37:55 +00:00
Lubos Lunak 576a0415cb do not warn about unknown pragmas in modes that do not handle them (pr9537)
And refactor to have just one place in code that sets up the empty
pragma handlers.

llvm-svn: 207758
2014-05-01 12:54:03 +00:00
Lubos Lunak c5f2bca866 write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

llvm-svn: 207756
2014-05-01 12:45:08 +00:00
Nico Weber 2d942deb19 Make RewriteRope less confusing for me. No intended behavior change.
llvm-svn: 207032
2014-04-23 21:42:27 +00:00
Fariborz Jahanian db3a5dcc60 Objective-C rewriter. Use _WIN64 instead of __LLP64__
to conditinalize on 64bit length in a generated meta-data.
// rdar://16489050

llvm-svn: 206402
2014-04-16 17:03:06 +00:00
Fariborz Jahanian 287e79a263 Objective-C modern translator. Fix declaration of
__NSConstantStringImpl's length field to accomodate
window's 64bit LLP64 mode. // rdar://16489050

llvm-svn: 205353
2014-04-01 19:32:35 +00:00
Aaron Ballman 40bd0aaf68 [C++11] Replacing FunctionProtoType iterators param_type_begin() and param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204045
2014-03-17 15:23:01 +00:00
Craig Topper fb6b25b5e4 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203999
2014-03-15 04:29:04 +00:00
Aaron Ballman 9371dd2287 [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203958
2014-03-14 18:34:04 +00:00