summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/JumpDiagnostics.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-2/+2
| | | | llvm-svn: 110945
* Labels (and case statement) don't create independent scope parents for theJohn McCall2010-08-021-16/+18
| | | | | | | | purposes of the jump checker. Also extend Ted's iteration fix to labels. Fixes PR7789. llvm-svn: 110082
* Fix another case (this time in JumpScopeChecker) where walking deeply nested ↵Ted Kremenek2010-08-021-1/+11
| | | | | | CaseStmts can blow out the stack. Fixes <rdar://problem/8125165>. llvm-svn: 110071
* Be a bit more careful with undefined CXXRecordDecls. FixesDouglas Gregor2010-07-011-5/+7
| | | | | | rdar://problem/8124080 and PR7118. llvm-svn: 107358
* Alter the internal representation of the condition variable inDouglas Gregor2010-06-211-20/+38
| | | | | | | | | | | | | | | | if/while/switch/for statements to ensure that walking the children of these statements actually works. Previously, we stored the condition variable as a VarDecl. However, StmtIterator isn't able to walk from a VarDecl to a set of statements, and would (in some circumstances) walk beyond the end of the list of statements, cause Bad Behavior. In this change, we've gone back to representing the condition variables as DeclStmts. While not as memory-efficient as VarDecls, it greatly simplifies iteration over the children. Fixes the remainder of <rdar://problem/8104754>. llvm-svn: 106504
* Improve commentary on the indirect-goto jump scope checker and extractJohn McCall2010-05-121-69/+76
| | | | | | a convenience routine to find the innermost common ancestor of two scopes. llvm-svn: 103565
* When checking scopes for indirect goto, be more permissive (but still safe)John McCall2010-05-121-70/+249
| | | | | | | | | | | | | | | | | | | | | | | | | about the permitted scopes. Specifically: 1) Permit labels and gotos to appear after a prologue of variable initializations. 2) Permit indirect gotos to jump out of scopes that don't require cleanup. 3) Diagnose possible attempts to indirect-jump out of scopes that do require cleanup. This requires a substantial reinvention of the algorithm for checking indirect goto. The current algorithm is Omega(M*N), with M = the number of unique scopes being jumped from and N = the number of unique scopes being jumped to, with an additional factor that is probably (worst-case) linear in the depth of scopes. Thus the entire thing is likely cubic given some truly bizarre ill-formed code; on well-formed code the additional factor collapses to an amortized constant (when amortized over the entire function) and so the algorithm is quadratic. Even this requires every label to appear in its own scope, which would be very unusual for indirect-goto code (and extremely unlikely for well-formed code); it is far more likely that all labels will be in the same scope and so the algorithm becomes linear. For such a marginal feature, I am fairly happy with this result. (this is using JumpDiagnostic's definition of scope, where successive variables in a block appear in their own scope) llvm-svn: 103536
* Improve the AST representation of Objective-C @try/@catch/@finallyDouglas Gregor2010-04-231-2/+2
| | | | | | | | | | statements. Instead of the @try having a single @catch, where all of the @catch's were chained (using an O(n^2) algorithm nonetheless), @try just holds an array of its @catch blocks. The resulting AST is slightly more compact (not important) and better represents the actual language semantics (good). llvm-svn: 102221
* Make a note for the C++0x future, when we'll have to revisit the ↵Douglas Gregor2010-03-081-0/+2
| | | | | | jump-diagnostics handling for variables without initializers llvm-svn: 97929
* Implement jump checking for initialized c++ variables, implementingChris Lattner2010-03-011-6/+8
| | | | | | | | | | | | | | | | | | a fixme and PR6451. Only perform jump checking if the containing function has no errors, and add the infrastructure needed to do this. On the testcase in the PR, we produce: t.cc:6:3: error: illegal goto into protected scope goto later; ^ t.cc:7:5: note: jump bypasses variable initialization X x; ^ llvm-svn: 97497
* Silence some warnings produced by Clang, and add a missing headerDouglas Gregor2009-11-171-1/+1
| | | | llvm-svn: 89051
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-30/+30
| | | | llvm-svn: 81346
* enhance the goto checker to reject jumps across __block variable definitions.Chris Lattner2009-07-191-0/+2
| | | | llvm-svn: 76376
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-3/+3
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-3/+3
| | | | llvm-svn: 73702
* Improve validation of C++ exception handling: diagnose throwing incomplete ↵Sebastian Redl2009-04-271-2/+22
| | | | | | types and jumps into protected try-catch scopes. llvm-svn: 70242
* split ObjC and C++ Statements out into their own headers.Chris Lattner2009-04-261-0/+1
| | | | llvm-svn: 70105
* add support for goto checking and @synchronized blocks,Chris Lattner2009-04-211-0/+16
| | | | | | rdar://6810106 llvm-svn: 69667
* move jump scope checking and related code out into its own file, SemaDecl.cpp isChris Lattner2009-04-191-0/+290
already too large. llvm-svn: 69505
OpenPOWER on IntegriCloud