summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/AnalysisDeclContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] add LocationContext::inTopFrame() helper.Anna Zaks2012-11-031-0/+4
| | | | llvm-svn: 167351
* Add clarifying comment.Ted Kremenek2012-09-241-0/+2
| | | | llvm-svn: 164557
* Implement faux-body-synthesis of well-known functions in the static analyzer ↵Ted Kremenek2012-09-211-6/+25
| | | | | | | | | | | | | | | | | | | | | | | when their implementations are unavailable. Start by simulating dispatch_sync(). This change is largely a bunch of plumbing around something very simple. We use AnalysisDeclContext to conjure up a fake function body (using the current ASTContext) when one does not exist. This is controlled under the analyzer-config option "faux-bodies", which is off by default. The plumbing in this patch is largely to pass the necessary machinery around. CallEvent needs the AnalysisDeclContextManager to get the function definition, as one may get conjured up lazily. BugReporter and PathDiagnosticLocation needed to be relaxed to handle invalid locations, as the conjured body has no real source locations. We do some primitive recovery in diagnostic generation to generate some reasonable locations (for arrows and events), but it can be improved. llvm-svn: 164339
* [analyzer] Always include destructors in the analysis CFG.Jordan Rose2012-09-051-2/+4
| | | | | | | | | | | | | | | | | | | | | While destructors will continue to not be inlined (unless the analyzer config option 'c++-inlining' is set to 'destructors'), leaving them out of the CFG is an incomplete model of the behavior of an object, and can cause false positive warnings (like PR13751, now working). Destructors for temporaries are still not on by default, since (a) we haven't actually checked this code to be sure it's fully correct (in particular, we probably need to be very careful with regard to lifetime-extension when a temporary is bound to a reference, C++11 [class.temporary]p5), and (b) ExprEngine doesn't actually do anything when it sees a temporary destructor in the CFG -- not even invalidate the object region. To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which controlled all implicit destructors, has been removed. llvm-svn: 163264
* [analyzer] Don't crash on implicit statements inside initializers.Jordan Rose2012-07-261-1/+9
| | | | | | | | | | | | | | | | | | | Our BugReporter knows how to deal with implicit statements: it looks in the ParentMap until it finds a parent with a valid location. However, since initializers are not in the body of a constructor, their sub-expressions are not in the ParentMap. That was easy enough to fix in AnalysisDeclContext. ...and then even once THAT was fixed, there's still an extra funny case of Objective-C object pointer fields under ARC, which are initialized with a top-level ImplicitValueInitExpr. To catch these cases, PathDiagnosticLocation will now fall back to the start of the current function if it can't find any other valid SourceLocations. This isn't great, but it's miles better than a crash. (All of this is only relevant when constructors and destructors are being inlined, i.e. under -cfg-add-initializers and -cfg-add-implicit-dtors.) llvm-svn: 160810
* Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.Benjamin Kramer2012-07-041-0/+1
| | | | llvm-svn: 159723
* static analyzer: add inlining support for directly called blocks.Ted Kremenek2012-06-011-14/+27
| | | | llvm-svn: 157833
* [analyzer] Remove references to idx::TranslationUnit. Index is dead, ↵Jordy Rose2012-04-281-8/+3
| | | | | | cross-TU inlining never panned out. llvm-svn: 155751
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Replace a map of boolean values with a set.Benjamin Kramer2012-03-101-14/+8
| | | | | | No functionality change. llvm-svn: 152494
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-11/+7
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* 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
* Colorize and condense CFG pretty-printing.Ted Kremenek2011-12-221-2/+2
| | | | llvm-svn: 147203
* Enhance AnalysisDeclContext::getReferencedBlockVars() to understand ↵Ted Kremenek2011-12-221-1/+11
| | | | | | | | PseudoObjExprs. It turns out that the information collected by this method is a super set of the captured variables in BlockDecl. llvm-svn: 147122
* [analyzer] teach AnalysisDeclContext::getSelfDecl() about blocks that ↵Ted Kremenek2011-11-141-0/+9
| | | | | | capture the 'self' variable of the enclosing ObjC method decl. Fixes <rdar://problem/10380300>. llvm-svn: 144556
* Actually rename the file AnalysisContext.cpp -> AnalysisDeclContext.cppChandler Carruth2011-10-241-0/+454
to match the CMakeLists.txt change in r142782; this should fix the CMake build. llvm-svn: 142784
OpenPOWER on IntegriCloud