summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-151-10/+10
| | | | | | class. llvm-svn: 203999
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-092-2/+2
| | | | llvm-svn: 203389
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-072-7/+7
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-072-2/+2
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
* Added an inserter for ArrayRef<SourceRange>.Alexander Kornienko2014-03-061-12/+4
| | | | | | | | | | | | | | Summary: Added an inserter for ArrayRef<SourceRange>, as it is already needed in at least two places (static analyzer and clang-tidy). Reviewers: jordan_rose CC: cfe-commits, gribozavr Differential Revision: http://llvm-reviews.chandlerc.com/D2984 llvm-svn: 203117
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202625
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-261-2/+1
| | | | llvm-svn: 202238
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-211-10/+0
| | | | | | | | | | | | | | | | | | | introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. llvm-svn: 201842
* Allow specifying a custom PathDiagnosticConsumer for use with the static ↵Alexander Kornienko2014-02-031-19/+27
| | | | | | | | | | | | | | | | | analyzer. Summary: Make objects returned by CreateAnalysisConsumer expose an interface, that allows providing a custom PathDiagnosticConsumer, so that users can have raw data in a form easily usable from the code (unlike plist/HTML in a file). Reviewers: jordan_rose, krememek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2556 llvm-svn: 200710
* [CMake] Prune stray entries in add_dependencies(). target_link_libraries() ↵NAKAMURA Takumi2014-01-311-2/+0
| | | | | | implies it. llvm-svn: 200531
* [CMake] clangStaticAnalyzerFrontend: Deprecate LLVM_NO_RTTI.NAKAMURA Takumi2014-01-281-2/+0
| | | | llvm-svn: 200296
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-1/+1
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* Make clang::ento::CreateAnalysisConsumer a part of a public interface of the ↵Alexander Kornienko2014-01-033-45/+2
| | | | | | | | | | | | | | | | | | static analyzer. Summary: This allows for a better alternative to the FrontendAction hack used in clang-tidy in order to get static analyzer's ASTConsumer. Reviewers: jordan_rose, krememek Reviewed By: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2505 llvm-svn: 198426
* Fix another misuse of getCustomDiagID()Alp Toker2013-12-231-25/+13
| | | | | | There's no need to escape strings and generate new DiagIDs for each message. llvm-svn: 197915
* [analyzer] Use DataRecursiveASTVisitor for the AnalysisConsumer.Argyrios Kyrtzidis2013-12-201-2/+2
| | | | llvm-svn: 197767
* [CMake] clang/lib: Prune redundant dependencies.NAKAMURA Takumi2013-12-101-3/+0
| | | | llvm-svn: 196864
* [CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on ↵NAKAMURA Takumi2013-12-091-2/+8
| | | | | | | | target_link_libraries() and LLVM_LINK_COMPONENTS. I will prune redundant dependencies later. llvm-svn: 196800
* Split isFromMainFile into two functions.Eli Friedman2013-08-221-1/+1
| | | | | | | | | Basically, isInMainFile considers line markers, and isWrittenInMainFile doesn't. Distinguishing between the two is useful when dealing with files which are preprocessed files or rewritten with -frewrite-includes (so we don't, for example, print useless warnings). llvm-svn: 188968
* [analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer.Jordan Rose2013-08-161-19/+55
| | | | | | | | | | | | | | | | | | | | This once again restores notes to following their associated warnings in -analyzer-output=text mode. (This is still only intended for use as a debugging aid.) One twist is that the warning locations in "regular" analysis output modes (plist, multi-file-plist, html, and plist-html) are reported at a different location on the command line than in the output file, since the command line has no path context. This commit makes -analyzer-output=text behave like a normal output format, which means that the *command line output will be different* in -analyzer-text mode. Again, since -analyzer-text is a debugging aid and lo-fi stand-in for a regular output mode, this change makes sense. Along the way, remove a few pieces of stale code related to the path diagnostic consumers. llvm-svn: 188514
* Use llvm::sys::fs::createTemporaryFile.Rafael Espindola2013-07-051-1/+1
| | | | llvm-svn: 185717
* We only create one file, no need to delete a directory.Rafael Espindola2013-06-261-8/+7
| | | | llvm-svn: 184949
* Remove unused include.Rafael Espindola2013-06-261-1/+0
| | | | llvm-svn: 184922
* Remove more uses of llvm::sys::Path.Rafael Espindola2013-06-261-26/+13
| | | | llvm-svn: 184921
* Use the sys::ExecuteAndWait that takes StringRefs.Rafael Espindola2013-06-131-2/+2
| | | | | | Also don't depend on Program.h including PathV1.h. llvm-svn: 183935
* Update for llvm change.Rafael Espindola2013-06-131-2/+3
| | | | llvm-svn: 183930
* Use the global functions instead of the Program methods.Rafael Espindola2013-06-121-2/+2
| | | | llvm-svn: 183861
* Factor CheckerManager to be able to pass AnalyzerOptions to checkersTed Kremenek2013-04-161-2/+3
| | | | | | | | during checker registration. There are no immediate clients of this, but this provides a way for checkers to query the options table at startup instead. llvm-svn: 179626
* [analyzer] Change inlining policy to inline small functions when reanalyzing ↵Anna Zaks2013-03-261-14/+11
| | | | | | | | ObjC methods as top level. This allows us to better reason about(inline) small wrapper functions. llvm-svn: 178063
* [analyzer] Fix typo.Anna Zaks2013-02-071-1/+1
| | | | llvm-svn: 174679
* [analyzer] Print Inline mode with -analyzer-display-progress.Anna Zaks2013-02-021-4/+15
| | | | llvm-svn: 174244
* [analyzer] Make shallow mode more shallow.Anna Zaks2013-01-301-1/+1
| | | | | | | | | | | | | | | | Redefine the shallow mode to inline all functions for which we have a definite definition (ipa=inlining). However, only inline functions that are up to 4 basic blocks large and cut the max exploded nodes generated per top level function in half. This makes shallow faster and allows us to keep inlining small functions. For example, we would keep inlining wrapper functions and constructors/destructors. With the new shallow, it takes 104s to analyze sqlite3, whereas the deep mode is 658s and previous shallow is 209s. llvm-svn: 173958
* Re-sort #include lines using the llvm/utils/sort_includes.py script.Chandler Carruth2013-01-021-1/+1
| | | | | | | Removes a duplicate #include as well as cleaning up some sort order regressions since I last ran the script over Clang. llvm-svn: 171364
* [analyzer] Re-apply r170826 and make the dumping of the GallGraphAnna Zaks2012-12-211-44/+18
| | | | | | | | | | | | | | | | | | | | | | | deterministic. Commit message for r170826: [analyzer] Traverse the Call Graph in topological order. Modify the call graph by removing the parentless nodes. Instead all nodes are children of root to ensure they are all reachable. Remove the tracking of nodes that are "top level" or global. This information is not used and can be obtained from the Decls stored inside CallGraphNodes. Instead of existing ordering hacks, analyze the functions in topological order over the Call Graph. Together with the addition of devirtualizable ObjC message sends and blocks to the call graph, this gives around 6% performance improvement on several large ObjC benchmarks. llvm-svn: 170906
* Revert r170826. The output ofRafael Espindola2012-12-211-18/+44
| | | | | | | | ./bin/clang -cc1 -internal-isystem /home/espindola/llvm/build/lib/clang/3.3/include/ -analyze -analyzer-checker=debug.DumpCallGraph /home/espindola/llvm/clang/test/Analysis/debug-CallGraph.c -fblocks changes in each run. llvm-svn: 170829
* [analyzer] Traverse the Call Graph in topological order.Anna Zaks2012-12-211-44/+18
| | | | | | | | | | | | | | | | | Modify the call graph by removing the parentless nodes. Instead all nodes are children of root to ensure they are all reachable. Remove the tracking of nodes that are "top level" or global. This information is not used and can be obtained from the Decls stored inside CallGraphNodes. Instead of existing ordering hacks, analyze the functions in topological order over the Call Graph. Together with the addition of devirtualizable ObjC message sends and blocks to the call graph, this gives around 6% performance improvement on several large ObjC benchmarks. llvm-svn: 170826
* [analyzer] Add blocks and ObjC messages to the call graph.Anna Zaks2012-12-211-30/+18
| | | | | | | | | | | This paves the road for constructing a better function dependency graph. If we analyze a function before the functions it calls and inlines, there is more opportunity for optimization. Note, we add call edges to the called methods that correspond to function definitions (declarations with bodies). llvm-svn: 170825
* Pass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options ↵Ted Kremenek2012-12-191-5/+8
| | | | | | | | accessible there. This is plumbing needed for later functionality changes. llvm-svn: 170488
* [analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.Anna Zaks2012-12-171-3/+5
| | | | llvm-svn: 170362
* [analyzer] Refactor: Store visited Decls instead of CallGraphNodes.Anna Zaks2012-12-141-24/+22
| | | | llvm-svn: 170231
* [analyzer] Optimization heuristic: do not reanalyze every ObjC method asAnna Zaks2012-12-071-17/+61
| | | | | | | | | | | | | | | | | | top level. This heuristic is already turned on for non-ObjC methods (inlining-mode=noredundancy). If a method has been previously analyzed, while being inlined inside of another method, do not reanalyze it as top level. This commit applies it to ObjCMethods as well. The main caveat here is that to catch the retain release errors, we are still going to reanalyze all the ObjC methods but without inlining turned on. Gives 21% performance increase on one heavy ObjC benchmark, which suffered large performance regressions due to ObjC inlining. llvm-svn: 169639
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-043-22/+20
| | | | | | | | | | | | | 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
* [analyzer] Don't run non-path-sensitive checks on system headers...Jordan Rose2012-10-101-24/+40
| | | | | | | | | | | | | | | ...but do run them on user headers. Previously, we were inconsistent here: non-path-sensitive checks on code /bodies/ were only run in the main source file, but checks on /declarations/ were run in /all/ headers. Neither of those is the behavior we want. Thanks to Sujit for pointing this out! <rdar://problem/12454226> llvm-svn: 165635
* [analyzer] Fix typo: s/HandleDeclsGallGraph/HandleDeclsCallGraph/gJordan Rose2012-10-101-3/+3
| | | | | | No functionality change. llvm-svn: 165634
* [analyzer] Do not visit ObjCMethodDecl twice in the AST checkers.Anna Zaks2012-09-291-1/+0
| | | | llvm-svn: 164869
* Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek2012-09-011-1/+2
| | | | | | | This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. llvm-svn: 163050
* Make AnalyzerOptions a shared object between CompilerInvocation andTed Kremenek2012-08-312-18/+18
| | | | | | | AnalysisManager, allowing the StringMap of configuration values to be propagated. llvm-svn: 162978
* Move AnalyzerOptions.h into 'Core' StaticAnalyzer sub-library.Ted Kremenek2012-08-312-5/+5
| | | | llvm-svn: 162977
* [analyzer] Ensure that PathDiagnostics profile the same regardless of path.Jordan Rose2012-08-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | PathDiagnostics are actually profiled and uniqued independently of the path on which the bug occurred. This is used to merge diagnostics that refer to the same issue along different paths, as well as by the plist diagnostics to reference files created by the HTML diagnostics. However, there are two problems with the current implementation: 1) The bug description is included in the profile, but some PathDiagnosticConsumers prefer abbreviated descriptions and some prefer verbose descriptions. Fixed by including both descriptions in the PathDiagnostic objects and always using the verbose one in the profile. 2) The "minimal" path generation scheme provides extra information about which events came from macros that the "extensive" scheme does not. This resulted not only in different locations for the plist and HTML diagnostics, but also in diagnostics being uniqued in the plist output but not in the HTML output. Fixed by storing the "end path" location explicitly in the PathDiagnostic object, rather than trying to find the last piece of the path when the diagnostic is requested. This should hopefully finish unsticking our internal buildbot. llvm-svn: 162965
* [analyzer] Refactor the logic that determines if a functions should beAnna Zaks2012-08-301-2/+18
| | | | | | | | | | | | reanalyzed. The policy on what to reanalyze should be in AnalysisConsumer with the rest of visitation order logic. There is no reason why ExprEngine needs to pass the Visited set to CoreEngine, it can populate it itself. llvm-svn: 162957
* Rename 'VisualizeEGUbi' and 'VisualizeEGDot' to ↵Ted Kremenek2012-08-301-2/+2
| | | | | | | | 'visualizeExplodedGraphWithUbigGraph' and 'visualizeExplodedGraphWithGraphViz' respectively. llvm-svn: 162931
OpenPOWER on IntegriCloud