Skip to content
  1. Mar 04, 2009
    • Chris Lattner's avatar
      Change Parser::ParseCaseStatement to use an iterative approach to parsing · 34a22091
      Chris Lattner authored
      multiple sequential case statements instead of doing it with recursion.  This
      fixes a problem where we run out of stack space parsing 100K directly nested
      cases.
      
      There are a couple other problems that prevent this from being useful in 
      practice (right now the example only parses correctly with -disable-free and
      doesn't work with -emit-llvm), but this is a start.
      
      I'm not including a testcase because it is large and uninteresting for 
      regtesting.
      
      Sebastian, I would appreciate it if you could scrutinize the smart pointer 
      gymnastics I do.
      
      llvm-svn: 66011
      34a22091
    • Steve Naroff's avatar
      Change a warning to an error... · 013813dd
      Steve Naroff authored
      llvm-svn: 65978
      013813dd
  2. Mar 03, 2009
  3. Mar 02, 2009
  4. Mar 01, 2009
  5. Feb 28, 2009
    • Anders Carlsson's avatar
      Fix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable... · 6c885805
      Anders Carlsson authored
      Fix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable will have the right type by the time the initializer is checked. This ensures that code like
      
      int a[(int)(1.0 / 1.0) = { 1 } will work.
      
      Eli, please review.
       
      
      llvm-svn: 65725
      6c885805
    • Steve Naroff's avatar
      4f967391
    • Chris Lattner's avatar
      Fix a crash in test/Parser/control-scope.c that testrunner didn't · 309e4869
      Chris Lattner authored
      notice because it was a negative test with a fix suggested by
      Jean-Daniel Dupas.  Convert the test from a negative to a positive
      test to catch stuff like this.
      
      llvm-svn: 65708
      309e4869
    • Steve Naroff's avatar
      70f41d6f
    • Steve Naroff's avatar
      Fix <rdar://problem/6451399> problems with labels and blocks. · d123bd05
      Steve Naroff authored
      - Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
      - Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
      - Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
      - Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).  
      
      llvm-svn: 65694
      d123bd05
    • Eli Friedman's avatar
      Check a few more kinds of declarations that make a scope. · cba899ff
      Eli Friedman authored
      llvm-svn: 65680
      cba899ff
    • Eli Friedman's avatar
      Start of checking for gotos which jump to an illegal destination. · f69d09ba
      Eli Friedman authored
      As far as I know, this catches all cases of jumping into the scope of a 
      variable with a variably modified type (excluding statement 
      expressions) in C.  This is missing some stuff we probably want to check
      (other kinds of variably modified declarations, statement expressions, 
      indirect gotos/addresses of labels in a scope, ObjC @try/@finally, cleanup 
      attribute), the diagnostics aren't very good, and it's not particularly 
      efficient, but it's a decent start.
      
      This patch is a slightly modified version of the patch I attached to
      PR3259, and it fixes that bug.  I was sort of planning on improving 
      it, but I think it's okay as-is, especially since it looks like CodeGen 
      doesn't have any use for this sort of data structure.  The only 
      significant change I can think of from the version I attached to PR3259 
      is that this version skips running the checking code when a function 
      doesn't contain any labels.
      
      This patch doesn't cover case statements, which also need similar 
      checking; I'm not sure how we should deal with that. Extending the goto 
      checking to also check case statements wouldn't be too hard; it's just a 
      matter of keeping track of the scope of the closest switch and checking that
      the scope of every case is the same as the scope of the switch.  That said, 
      it would likely be a performance hit to run this check on every 
      function (it's an extra pass over the entire function), so we probably want
      some other solution.
      
      llvm-svn: 65678
      f69d09ba
    • Douglas Gregor's avatar
      Eliminate CXXRecordType · 89ee6822
      Douglas Gregor authored
      llvm-svn: 65671
      89ee6822
    • Douglas Gregor's avatar
      Add a FIXME for something I can't look at just yet · 0ab407d5
      Douglas Gregor authored
      llvm-svn: 65669
      0ab407d5
    • Douglas Gregor's avatar
      Template instantiation for function types · 6eaaf309
      Douglas Gregor authored
      llvm-svn: 65668
      6eaaf309
    • Douglas Gregor's avatar
      Implement template instantiation for pointer, reference, and (some) · 17c0d7ba
      Douglas Gregor authored
      array types. Semantic checking for the construction of these types has
      been factored out of GetTypeForDeclarator and into separate
      subroutines (BuildPointerType, BuildReferenceType,
      BuildArrayType). We'll be doing the same thing for all other types
      (and declarations and expressions).
      
      As part of this, moved the type-instantiation functions into a class
      in an anonymous namespace. 
      
      llvm-svn: 65663
      17c0d7ba
  6. Feb 27, 2009
Loading