summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Make checkEndFunction() give access to the return statement.Reka Kovacs2018-07-161-2/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D49387 llvm-svn: 337215
* [analyzer] [NFC] A convenient getter for getting a current stack frameGeorge Karpenkov2018-06-271-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D44756 llvm-svn: 335701
* [analyzer] Do not run visitors until the fixpoint, run only once.George Karpenkov2018-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current implementation, we run visitors until the fixed point is reached. That is, if a visitor adds another visitor, the currently processed path is destroyed, all diagnostics is discarded, and it is regenerated again, until it's no longer modified. This pattern has a few negative implications: - This loop does not even guarantee to terminate. E.g. just imagine two visitors bouncing a diagnostics around. - Performance-wise, e.g. for sqlite3 all visitors are being re-run at least 10 times for some bugs. We have already seen a few reports where it leads to timeouts. - If we want to add more computationally intense visitors, this will become worse. - From architectural standpoint, the current layout requires copying visitors, which is conceptually wrong, and can be annoying (e.g. no unique_ptr on visitors allowed). The proposed change is a much simpler architecture: the outer loop processes nodes upwards, and whenever the visitor is added it only processes current nodes and above, thus guaranteeing termination. Differential Revision: https://reviews.llvm.org/D47856 llvm-svn: 335666
* [analyzer] Fix an assertion fail in VirtualCallCheckerGabor Horvath2017-09-211-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D37978 llvm-svn: 313866
* [analyzer][GSoC] Re-implemente current virtual calls checker in a ↵Gabor Horvath2017-08-281-230/+223
| | | | | | | | | | path-sensitive way Patch by: Xin Wang Differential Revision: https://reviews.llvm.org/D34275 llvm-svn: 311877
* In VirtualCallChecker, handle indirect callsSam McCall2017-01-311-1/+2
| | | | | | | | | | | | | | | Summary: In VirtualCallChecker, handle indirect calls. getDirectCallee() can be nullptr, and dyn_cast(nullptr) is UB Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29303 llvm-svn: 293604
* [analyzer] Improve VirtualCallChecker diagnostics and move into optin package.Devin Coughlin2016-12-101-38/+83
| | | | | | | | | | | | | | | | | | The VirtualCallChecker is in alpha because its interprocedural diagnostics represent the call path textually in the diagnostic message rather than with a path sensitive diagnostic. This patch turns off the AST-based interprocedural analysis in the checker so that no call path is needed and improves with diagnostic text. With these changes, the checker is ready to be moved into the optin package. Ultimately the right fix is to rewrite this checker to be path sensitive -- but there is still value in enabling the checker for intraprocedural analysis only The interprocedural mode can be re-enabled with an -analyzer-config flag. Differential Revision: https://reviews.llvm.org/D26768 llvm-svn: 289309
* [analyzer] Apply whitespace cleanups by Honggyu Kim.Ted Kremenek2015-09-081-12/+12
| | | | llvm-svn: 246978
* Rewrite users of Stmt::child_begin/end into for-range loops.Benjamin Kramer2015-07-031-3/+3
| | | | | | No functionality change intended. llvm-svn: 241355
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | 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
* [analyzer] Don't warn on virtual calls in ctors to final methods.Benjamin Kramer2014-08-211-3/+10
| | | | | | | The call will never go to a more derived class, but that's intentional in those cases. llvm-svn: 216167
* [C++11] Use 'nullptr'. StaticAnalyzer edition.Craig Topper2014-05-271-1/+1
| | | | llvm-svn: 209642
* [C++11] Replacing CXXRecordDecl iterators ctor_begin() and ctor_end() with ↵Aaron Ballman2014-03-131-2/+1
| | | | | | iterator_range ctors(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203814
* Expose the name of the checker producing each diagnostic message.Alexander Kornienko2014-02-111-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In clang-tidy we'd like to know the name of the checker producing each diagnostic message. PathDiagnostic has BugType and Category fields, which are both arbitrary human-readable strings, but we need to know the exact name of the checker in the form that can be used in the CheckersControlList option to enable/disable the specific checker. This patch adds the CheckName field to the CheckerBase class, and sets it in the CheckerManager::registerChecker() method, which gets them from the CheckerRegistry. Checkers that implement multiple checks have to store the names of each check in the respective registerXXXChecker method. Reviewers: jordan_rose, krememek Reviewed By: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2557 llvm-svn: 201186
* [analyzer] ArrayRef-ize BugReporter::EmitBasicReport.Jordan Rose2013-10-071-2/+2
| | | | | | No functionality change. llvm-svn: 192114
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Include pruning and general cleanup.Benjamin Kramer2012-12-011-0/+1
| | | | llvm-svn: 169095
* Remove unused private member variables found by clang's new ↵Benjamin Kramer2012-06-061-1/+1
| | | | | | -Wunused-private-field. llvm-svn: 158086
* Include the "issue context" (e.g. function or method) where a static ↵Ted Kremenek2012-04-041-2/+4
| | | | | | | | analyzer issue occurred in the plist output. Fixes <rdar://problem/11004527> llvm-svn: 154030
* Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.Argyrios Kyrtzidis2012-03-011-1/+1
| | | | | | Needs llvm update. llvm-svn: 151829
* Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"Argyrios Kyrtzidis2012-02-271-1/+1
| | | | | | | | to make it more widely available. Depends on llvm commit r151564 llvm-svn: 151566
* Print NamedDecls directly to a raw_ostream where possible.Benjamin Kramer2012-02-071-3/+3
| | | | llvm-svn: 149982
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-0/+1
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* Add initial version of checker to check if virtual member functions are ↵Ted Kremenek2012-01-031-0/+238
called transitively from C++ constructors or destructors. Checker by Lei Zhang with a few tweaks by Ted Kremenek. llvm-svn: 147494
OpenPOWER on IntegriCloud