summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/AnalysisConsumer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change LLVMConventionsChecker to accept an entire translation unit insteadTed Kremenek2010-02-141-3/+2
| | | | | | | | | | | | | | | | of operating on each code decl. This exposes two flaws in AnalysisConsumer that should eventually be fixed: (1) It is not possible to associate multiple "actions" with a single command line argument. This will require the notion of an "analysis" group, and possibly tablegen support. (although eventually we want to support dynamically loading analyses as well) (2) AnalysisConsumer may not actually be scanning the declarations in namespaces. We'll experiment first in LLVMConventionsChecker before changing the behavior in AnalysisConsumer. llvm-svn: 96183
* Rework translation unit actions to actually take an entire translation unitTed Kremenek2010-02-141-43/+50
| | | | | | as imput. llvm-svn: 96182
* Add new static analyzer for checking LLVM coding conventions: ↵Ted Kremenek2010-02-141-0/+8
| | | | | | | | | | | | | -analyzer-check-llvm-conventions Currently these checks are intended to be largely syntactical, but may get more sophisticated over time. As an initial foray into this brave new world, emit a static analyzer warning when binding a temporary 'std::string' to an 'llvm::StringRef' where the lifetime of the 'std::string' does not outlive the 'llvm::StringRef'. llvm-svn: 96147
* Two changes to AnalysisConsumer::HandleTopLevelSingleDecl():Ted Kremenek2010-02-141-23/+11
| | | | | | | | | | | | (1) Since CXXMethodDecl subclasses FunctionDecl (and CXXDestructorDecl and CXXConversion subclass CXXMethodDecl), refactor switch statement to handle them all in one spot. (2) Use 'DeclarationName::getAsString()' to handle all functions that don't have simple identifiers (fixing a null dereference when scanning for specific functions). llvm-svn: 96146
* Rename -cc1 option '-checker-cfref' to '-analyzer-check-objc-mem'.Ted Kremenek2010-02-051-6/+6
| | | | llvm-svn: 95348
* Move 'LocalCheckers.h' to the 'Checkers' subdirectory.Ted Kremenek2010-01-261-1/+1
| | | | llvm-svn: 94609
* Move BugReporter.h, PathDiagnostic.h, and BugType.h to ↵Ted Kremenek2010-01-251-2/+2
| | | | | | 'include/Checker/BugReporter' llvm-svn: 94428
* Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek2010-01-251-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | (1) libAnalysis is a generic analysis library that can be used by Sema. It defines the CFG, basic dataflow analysis primitives, and inexpensive flow-sensitive analyses (e.g. LiveVariables). (2) libChecker contains the guts of the static analyzer, incuding the path-sensitive analysis engine and domain-specific checks. Now any clients that want to use the frontend to build their own tools don't need to link in the entire static analyzer. This change exposes various obvious cleanups that can be made to the layout of files and headers in libChecker. More changes pending. :) This change also exposed a layering violation between AnalysisContext and MemRegion. BlockInvocationContext shouldn't explicitly know about BlockDataRegions. For now I've removed the BlockDataRegion* from BlockInvocationContext (removing context-sensitivity; although this wasn't used yet). We need to have a better way to extend BlockInvocationContext (and any LocationContext) to add context-sensitivty. llvm-svn: 94406
* Also handle CXXConstructor, CXXDestructor and CXXConversion in CFGMike Stump2010-01-201-2/+4
| | | | | | printing. llvm-svn: 93968
* Use the llvm coding convention for indentation for switch.Mike Stump2010-01-201-48/+48
| | | | llvm-svn: 93966
* Remove references to 'Checker' and 'GRTransferFuncs' fromTed Kremenek2010-01-051-8/+4
| | | | | | | | | | | | GRStateManager. Having these references was an abstraction violation, as they really should only be known about GRExprEngine. This change required adding a new 'ProcessAssume' callback in GRSubEngine. GRExprEngine implements this callback by calling 'EvalAssume' on all registered Checker objects as well as the registered GRTransferFunc object. llvm-svn: 92549
* Let constraint manager inform checkers that some assumption logic has happend.Zhongxing Xu2009-12-311-2/+2
| | | | | | | | | Add new states for symbolic regions tracked by malloc checker. This enables us to do malloc checking more accurately. See test case. Based on Lei Zhang's patch and discussion. llvm-svn: 92342
* Remove an duplicated #include.Zhongxing Xu2009-12-301-1/+0
| | | | llvm-svn: 92306
* Register call inliner as the last checker.Zhongxing Xu2009-12-231-2/+3
| | | | llvm-svn: 91992
* Migrate the call inliner to the Checker interface.Zhongxing Xu2009-12-231-5/+34
| | | | llvm-svn: 91991
* Expose C++ methods to GRExprEngine.Zhongxing Xu2009-12-161-0/+14
| | | | llvm-svn: 91506
* Add comments.Zhongxing Xu2009-12-151-1/+2
| | | | llvm-svn: 91430
* Remove displayProgress parameter.Zhongxing Xu2009-12-151-1/+0
| | | | llvm-svn: 91429
* We should only scan for nested blocks if we are analyzing the body of a ↵Ted Kremenek2009-12-121-1/+1
| | | | | | function/method. llvm-svn: 91196
* Fix crash in DisplayFunction(). ObjCInterfaceDecls can also get passed to ↵Ted Kremenek2009-12-091-8/+5
| | | | | | this function, but we don't want to display them. llvm-svn: 90944
* Add clang-cc option '-analyzer-opt-analyze-nested-blocks' to treat block ↵Ted Kremenek2009-12-071-8/+33
| | | | | | literals as an entry point for analyzer checks. llvm-svn: 90810
* Remove VISIBILITY_HIDDEN from anonymous namespaces in libFrontend.Benjamin Kramer2009-11-281-2/+1
| | | | llvm-svn: 90033
* Call GRExprEngine::setTransferFunctions() after registering all Checkers. ↵Ted Kremenek2009-11-251-2/+2
| | | | | | This allows GRTransferFuncs::RegisterChecks() to always be called after all checkers have been registered. llvm-svn: 89887
* Consolidate logic in ActionInlineCall by having it call ActionGRExprEngine ↵Ted Kremenek2009-11-251-19/+3
| | | | | | instead of replicating most of its logic (and missing pieces). llvm-svn: 89886
* Make RegisterInternalChecks() part of GRExprEngine's private implementation ↵Ted Kremenek2009-11-251-1/+0
| | | | | | by making it a static function within GRExprEngine.cpp. llvm-svn: 89884
* Register internal checks with GRExprEngine when it is constructed, not ↵Ted Kremenek2009-11-251-2/+0
| | | | | | manually in AnalysisConsumer.cpp. llvm-svn: 89883
* Silence some warnings produced by Clang, and add a missing headerDouglas Gregor2009-11-171-7/+7
| | | | llvm-svn: 89051
* Add clang-cc option "--analyzer-experimental-internal-checks". ThisTed Kremenek2009-11-131-0/+4
| | | | | | | option enables new "internal" checks that will eventually be turned on by default but still require broader testing. llvm-svn: 88671
* Add clang-cc option "-analyzer-experimental-checks" to enable experimental ↵Ted Kremenek2009-11-131-1/+3
| | | | | | path-sensitive checks. The idea is to separate "barely working" or "skunkworks" checks from ones that should always run. Later we need more fine-grain checker control. llvm-svn: 87053
* Move the ManagerRegistry to the Analysis library to resolve the layering ↵Chandler Carruth2009-11-111-1/+1
| | | | | | violation. llvm-svn: 86863
* Fix display of "ANALYZE" statements in AnalysisConsumer by correctly ↵Ted Kremenek2009-11-111-114/+146
| | | | | | resetting the flag indicating that the current Decl* has not yet been displayed. Also move this out of AnalysisManager, since AnalysisManager should not handle text output to the user. llvm-svn: 86812
* Add a checker for CWE-467: Use of sizeof() on a Pointer Type.Zhongxing Xu2009-11-081-0/+5
| | | | llvm-svn: 86464
* Convert CreateAnalysisConsumer and friends to just take a const ↵Daniel Dunbar2009-11-051-25/+21
| | | | | | Preprocessor&, and simplify. llvm-svn: 86112
* Acting on Daniel's nagging, remove PathDiagnosticClientFactory() andTed Kremenek2009-11-051-3/+2
| | | | | | | | migrate work in the destructors of PathDiagnosticClients from their destructors to FlushReports(). The destructors now currently call FlushReports(); this will be fixed in a subsequent patch. llvm-svn: 86108
* Kill PreprocessorFactory, which was both morally repugnant and totally unused.Daniel Dunbar2009-11-041-12/+7
| | | | llvm-svn: 86076
* Remove unused header.Daniel Dunbar2009-11-021-1/+0
| | | | llvm-svn: 85828
* Add destructor and cleanup code to LocationContext (fixing some leaks). ↵Ted Kremenek2009-10-201-0/+3
| | | | | | | | | Along the way, have AnalysisManager periodically cleanup its AnalysisContextManager and LocationContextManager objects, as they don't need to forever retain all the CFGs ever created when analyzing a file. llvm-svn: 84684
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-1/+1
| | | | | | are updated. llvm-svn: 84447
* Hoist some branches in AnalysisManager::HandleTranslationUnit so weTed Kremenek2009-09-261-16/+19
| | | | | | | | avoid scanning for an "entry point" FunctionDecl if we (a) have no translation unit actions and (b) no entry point function has been specified. llvm-svn: 82846
* Fix regression introduced by r82198 that caused functions/methods with ↵Ted Kremenek2009-09-181-1/+6
| | | | | | invalid CFGs to get analyzed. llvm-svn: 82297
* Introduce caching of diagnostics in BugReporter. This provides extraTed Kremenek2009-09-181-15/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | pruning of diagnostics that may be emitted multiple times. This is accomplished by adding FoldingSet profiling support to PathDiagnostic, and then having BugReporter record what diagnostics have been issued. This was motived to a serious bug introduced by moving the 'divide-by-zero' checking outside of GRExprEngine into a separate 'Checker' class. When analyzing code using the '-fobjc-gc' option, a given function would be analyzed twice, but the second time various "internal checks" would be disabled to avoid emitting multiple diagnostics (e.g., "null dereference") for the same issue. The problem is that such checks also effect path pruning and don't just emit diagnostics. This resulted in an assertion failure involving a real divide-by-zero in some analyzed code where we would get an assertion failure in APInt because the 'DivZero' check was disabled and didn't prune the logic that resulted in the divide-by-zero in the analyzer. The implemented solution is somewhat of a hack, and may not perform extremely well. This will need to be cleaned up over time. As a regression test, 'misc-ps.m' has been modified so that its tests are run using -fobjc-gc to test this diagnostic pruning behavior. llvm-svn: 82198
* Start to add a new transfer function that inlines callee. To be continued.Zhongxing Xu2009-09-111-0/+22
| | | | llvm-svn: 81501
* Make AnalysisManager stateless. Now other analyzer components only depends onZhongxing Xu2009-09-101-46/+55
| | | | | | local node information. llvm-svn: 81433
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-72/+72
| | | | llvm-svn: 81346
* Update clang for raw_fd_ostream no longer requiring F_Force.Dan Gohman2009-08-251-2/+1
| | | | llvm-svn: 79991
* Remove CodeDecl and CFG from GRExprEngine and GRStateManager.Zhongxing Xu2009-08-251-6/+3
| | | | | | | Now AnalysisManager is the only place we can get CodeDecl. This leads to an API change: GRState::bindExpr() now takes the CFG argument. llvm-svn: 79980
* API changes to match llvm ToT.Chris Lattner2009-08-231-3/+2
| | | | llvm-svn: 79868
* Replace cerr with errs().Benjamin Kramer2009-08-231-6/+5
| | | | llvm-svn: 79854
* adjust for raw_fd_ostream api change.Chris Lattner2009-08-231-2/+2
| | | | llvm-svn: 79809
* Tie the local check NSErrorCheck to a Decl to pave the wayZhongxing Xu2009-08-211-1/+1
| | | | | | to untie the ExplodedGraph from a specific Decl. llvm-svn: 79588
OpenPOWER on IntegriCloud