summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CFG.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move the source-level CFG from libAST to libAnalysis.Ted Kremenek2009-07-161-1924/+0
| | | | llvm-svn: 76092
* Fix a horrible CFG bug reported in <rdar://problem/7027684>. The wrong successorTed Kremenek2009-07-031-1/+1
| | | | | | | block would get hooked up in some cases when processing empty compound statements. llvm-svn: 74743
* Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.Chris Lattner2009-06-301-23/+36
| | | | | | | | | | | | This is simple enough, but then I thought it would be nice to make PrintingPolicy get a LangOptions so that various things can key off "bool" and "C++" independently. This spiraled out of control. There are many fixme's, but I think things are slightly better than they were before. One thing that can be improved: CFG should probably have an ASTContext pointer in it, which would simplify its clients. llvm-svn: 74493
* Remove unneeded #includes.Ted Kremenek2009-06-241-3/+0
| | | | llvm-svn: 74131
* Update for LLVM API changes.Owen Anderson2009-06-241-1/+2
| | | | llvm-svn: 74085
* Create a new PrintingPolicy class, which we pass down through the ASTDouglas Gregor2009-05-291-17/+20
| | | | | | | | | printing logic to help customize the output. For now, we use this rather than a special flag to suppress the "struct" when printing "struct X" and to print the Boolean type as "bool" in C++ but "_Bool" in C. llvm-svn: 72590
* source-level CFG: have the body for the @synchronized start with its own basicTed Kremenek2009-05-051-1/+12
| | | | | | block. This makes it a little easier for diagnostics generation. llvm-svn: 71037
* Add CFG support for @synchronized. This fixes <rdar://problem/6848820>.Ted Kremenek2009-05-021-3/+11
| | | | llvm-svn: 70620
* Fix crasher in CFG construction when not properly handling ASTs that containTed Kremenek2009-05-021-44/+106
| | | | | | | expressions not yet properly handled by the CFGBuilder. This failure resulted in a null CFGBlock* being used in rare cases (causing a crash). llvm-svn: 70612
* CFG: Add "loop back" block for do...while statements.Ted Kremenek2009-04-281-1/+11
| | | | llvm-svn: 70284
* CFG: 'WhileStmts' needs an extra block to indicate the "loop back" path.Ted Kremenek2009-04-281-5/+10
| | | | llvm-svn: 70280
* CFG:Ted Kremenek2009-04-281-11/+17
| | | | | | | | - Add 'LoopTarget' pointer field to CFGBlock. This records if the block is used as the 'loop back' path back to the head of a loop. - For ForStmt, encode the loop back target as the increment code. llvm-svn: 70274
* CFG: when there is not continue or break target, mark the CFG as bad.Ted Kremenek2009-04-071-4/+11
| | | | llvm-svn: 68533
* Remove hack support for @try...@finally in source-level CFGs. The current hackTed Kremenek2009-04-071-8/+1
| | | | | | had too many false positives in the analyzer. llvm-svn: 68492
* CFG: For 'if(...) {}' (empty body) construct an empty CFGBlock so that we canTed Kremenek2009-04-011-2/+7
| | | | | | distinguish between the true and false branches for path-sensitive analyses. llvm-svn: 68185
* Add partial CFG support for Objective-C exception-handling blocks. We basicallyTed Kremenek2009-03-301-5/+18
| | | | | | assume that @catch blocks are never executed. llvm-svn: 68072
* some random cleanupsChris Lattner2009-03-281-7/+3
| | | | llvm-svn: 67928
* rename some methods.Chris Lattner2009-03-281-31/+30
| | | | llvm-svn: 67923
* Fixup spacing.Mike Stump2009-02-261-2/+3
| | | | llvm-svn: 65519
* Remove DeclGroupOwningRef, since we intend for declarations to be ownedDouglas Gregor2009-02-131-5/+2
| | | | | | | | | | | | | | | by DeclContexts (always) rather than by statements. DeclContext currently goes out of its way to avoid destroying any Decls that might be owned by a DeclGroupOwningRef. However, in an error-recovery situation, a failure in a declaration statement can cause all of the decls in a DeclGroupOwningRef to be destroyed after they've already be added into the DeclContext. Hence, DeclContext is left with already-destroyed declarations, and bad things happen. This problem was causing failures that showed up as assertions on x86 Linux in test/Parser/objc-forcollection-neg-2.m. llvm-svn: 64474
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-201-5/+5
| | | | | | | | | | | | | | | | that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
* Add preliminary CFG support for @throw. We basically treat it like a return ↵Ted Kremenek2008-12-091-1/+23
| | | | | | statement. llvm-svn: 60790
* Introduce basic support for dependent types, type-dependentDouglas Gregor2008-12-051-0/+2
| | | | | | | | | | | | expressions, and value-dependent expressions. This permits us to parse some template definitions. This is not a complete solution; we're missing type- and value-dependent computations for most of the expression types, and we're missing checks for dependent types and type-dependent expressions throughout Sema. llvm-svn: 60615
* Fix CFG bug where the 'increment' block for a 'for' statement would not beTed Kremenek2008-11-241-2/+10
| | | | | | | | | | properly reversed once constructed. This fixes PR 3125: http://llvm.org/bugs/show_bug.cgi?id=3125 llvm-svn: 59982
* Fix CFG construction for ObjCForCollectionStmt: 'element' expression can be ↵Ted Kremenek2008-11-141-20/+44
| | | | | | anything that evaluates to an lvalue llvm-svn: 59289
* Hook up "BodyBlock", not "Block".Ted Kremenek2008-11-131-1/+1
| | | | llvm-svn: 59227
* Correctly connect 'continue' and 'break' statements in Objective-C fast ↵Ted Kremenek2008-11-131-0/+7
| | | | | | enumeration for blocks to the appropriate basic blocks. llvm-svn: 59226
* Fix bug where the body block of an ObjCForCollectionStmt would not properly ↵Ted Kremenek2008-11-131-1/+1
| | | | | | get expanded as a series of basic blocks. llvm-svn: 59197
* ObjCForCollectionStmts are block-level expressions.Ted Kremenek2008-11-121-5/+8
| | | | llvm-svn: 59160
* Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof ↵Sebastian Redl2008-11-111-19/+11
| | | | | | expressions, both of values and types. llvm-svn: 59057
* Add CFG support for Objective-C 2.0 fast enumeration 'for' statement:Ted Kremenek2008-11-111-13/+77
| | | | | | | | http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_7_section_2.html#//apple_ref/doc/uid/TP30001163-CH18-SW3 Need to modify GRExprEngine, LiveVariables, and UninitializedValues to understand this construct. llvm-svn: 59049
* Migrate DeclStmt over to using a DeclGroup instead of a pointer to a ↵Ted Kremenek2008-10-071-34/+17
| | | | | | | | ScopedDecl*. This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*. llvm-svn: 57275
* Use DeclStmt::decl_iterator to walk a group of Decl*'s instead of using the ↵Ted Kremenek2008-10-061-8/+12
| | | | | | ScopedDecl chain. llvm-svn: 57206
* Reverse the RHSBlock of LogicalOp && and ||Zhongxing Xu2008-10-041-0/+1
| | | | llvm-svn: 57041
* Add CFG support for implicit-control flow for VLA size expressions within an ↵Ted Kremenek2008-09-261-12/+23
| | | | | | SizeOfAlignOfTypeExpr. llvm-svn: 56706
* Do not create CFGs for functions/methods using blocks (need to add ↵Ted Kremenek2008-09-261-0/+9
| | | | | | control-flow). llvm-svn: 56672
* Move VLA processing logic from LiveVariables to CFG construction. This way ↵Ted Kremenek2008-09-261-11/+27
| | | | | | all dataflow analyses "see" the VLA size expressions. llvm-svn: 56655
* ProgramPoint now takes the space of two pointers instead of one. This change wasTed Kremenek2008-09-161-58/+0
| | | | | | | | | motivated because it became clear that the number of subclasses of ProgramPoint would expand and we ran out of bits to represent a pointer variant. As a plus of this change, BlockEdge program points can now be represented explicitly without using a cache of CFGBlock* pairs in CFG. llvm-svn: 56245
* Patch by Csaba Hruska!Ted Kremenek2008-09-131-13/+15
| | | | | | | "Here is a patch what replaces std::ostream with llvm::raw_ostream. This patch covers the AST library, but ignores Analysis lib." llvm-svn: 56185
* Fix CFG construction bug:Ted Kremenek2008-09-041-9/+15
| | | | | | | - Within for loops, 'continue' should jump to a basic block containing the increment code llvm-svn: 55800
* More #include cleaningDaniel Dunbar2008-08-111-1/+0
| | | | | | | | | | | - Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
* Cleanup some processing with DeclStmt, and gradually start using the ↵Ted Kremenek2008-08-061-22/+73
| | | | | | internal BumpPtrAllocator to allocator more of CFG's data structures. llvm-svn: 54433
* Always construct the BumpPtrAllocator used by CFG as an instance variable.Ted Kremenek2008-08-061-9/+2
| | | | llvm-svn: 54429
* Nico Weber:Ted Kremenek2008-08-041-1/+1
| | | | | | "the attached patch fixes some typos, 80 cols violations, etc. in comments." llvm-svn: 54328
* Fix one strict-aliasing warning.Ted Kremenek2008-05-291-8/+8
| | | | llvm-svn: 51707
* - Move ObjC Expresssion AST's from Expr.h => ExprObjC.hSteve Naroff2008-05-291-1/+1
| | | | | | - #include ExprObjC.h in many places llvm-svn: 51703
* Added CFGBlock::hasBinaryBranchTerminator().Ted Kremenek2008-05-161-0/+24
| | | | llvm-svn: 51190
* Bug fix in CFG::getBlockEdgeImpl(): Use a BumpPtrAllocator to allocateTed Kremenek2008-04-281-13/+71
| | | | | | | | | std::pair<CFGBlock*, CFGBlock*> that have an 8-byte alignment for use with ProgramPoint. This fixes a bug reported by Argiris where using std::set<> on Windows would result in a 4-byte alignment, not an 8-byte alignment. Fixes: <rdar://problem/5892265> llvm-svn: 50364
* Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a ↵Ted Kremenek2008-04-161-72/+137
| | | | | | | | | | | block's terminator. Refactored LiveVariables to use getTerminatorCondition() in VisitTerminator(). Bug fix: CFG now computes Block-level expression numbers using information from block terminators. This fixes <rdar://problem/5868189>. llvm-svn: 49818
* Bug fix in CFG construction: VisitCompoundStmt should return the last ↵Ted Kremenek2008-03-171-2/+4
| | | | | | created block. llvm-svn: 48460
OpenPOWER on IntegriCloud