Skip to content
  1. Mar 01, 2009
  2. 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
  3. Feb 27, 2009
  4. Feb 26, 2009
    • Douglas Gregor's avatar
      Make the type associated with a ClassTemplateSpecializationDecl be a · d56a91e8
      Douglas Gregor authored
      nicely sugared type that shows how the user wrote the actual
      specialization. This sugared type won't actually show up until we
      start doing instantiations.
      
      llvm-svn: 65577
      d56a91e8
    • Douglas Gregor's avatar
      Introduce code modification hints into the diagnostics system. When we · 87f95b0a
      Douglas Gregor authored
      know how to recover from an error, we can attach a hint to the
      diagnostic that states how to modify the code, which can be one of:
      
        - Insert some new code (a text string) at a particular source
          location
        - Remove the code within a given range
        - Replace the code within a given range with some new code (a text
          string)
      
      Right now, we use these hints to annotate diagnostic information. For
      example, if one uses the '>>' in a template argument in C++98, as in
      this code:
      
        template<int I> class B { };
        B<1000 >> 2> *b1;
      
      we'll warn that the behavior will change in C++0x. The fix is to
      insert parenthese, so we use code insertion annotations to illustrate
      where the parentheses go:
      
      test.cpp:10:10: warning: use of right-shift operator ('>>') in template
      argument will require parentheses in C++0x
        B<1000 >> 2> *b1;
               ^
          (        )
      
      
      Use of these annotations is partially implemented for HTML
      diagnostics, but it's not (yet) producing valid HTML, which may be
      related to PR2386, so it has been #if 0'd out.
      
      In this future, we could consider hooking this mechanism up to the
      rewriter to actually try to fix these problems during compilation (or,
      after a compilation whose only errors have fixes). For now, however, I
      suggest that we use these code modification hints whenever we can, so
      that we get better diagnostics now and will have better coverage when
      we find better ways to use this information.
      
      This also fixes PR3410 by placing the complaint about missing tokens
      just after the previous token (rather than at the location of the next
      token).
      
      llvm-svn: 65570
      87f95b0a
    • Daniel Dunbar's avatar
      Drop uses of getAsPointerLikeType. · b566c6c7
      Daniel Dunbar authored
       - No functionality change.
      
      llvm-svn: 65563
      b566c6c7
    • Steve Naroff's avatar
      Fix <rdar://problem/6574319> clang issues error on 'readonly' property with a... · de68001e
      Steve Naroff authored
      Fix <rdar://problem/6574319> clang issues error on 'readonly' property with a defaul setter attribute.
      
      Needed to make isPropertyReadonly() non-const (for this fix to compile). I imagine there's a way to retain the const-ness, however I have more important fish to fry.
      
      llvm-svn: 65562
      de68001e
    • Steve Naroff's avatar
      Fix <rdar://problem/6614945> method not found. · 42ab0dd1
      Steve Naroff authored
      This was a fairly recent regression.
      
      llvm-svn: 65547
      42ab0dd1
    • Steve Naroff's avatar
      Fix http://llvm.org/bugs/show_bug.cgi?id=3544. · b162f170
      Steve Naroff authored
      The code for looking up local/private method in Sema::ActOnInstanceMessage() was not handling categories properly. Sema::ActOnClassMessage() didn't have this bug.
      Created a helper with the correct logic and changed both methods to use it.
      
      llvm-svn: 65532
      b162f170
    • Sebastian Redl's avatar
      8d2ccae2
    • Eli Friedman's avatar
      Zap the Sema constant initializer checking code that we aren't using · 4f294cfe
      Eli Friedman authored
      anymore.  If we want to reuse bits and pieces to add strict checking for 
      constant initializers, we can dig them out of SVN history; the existing 
      code won't be useful as-is.
      
      llvm-svn: 65502
      4f294cfe
    • Eli Friedman's avatar
      Fix for PR3663/3669: use TryToFixInvalidVariablyModifiedType for · adf40d4b
      Eli Friedman authored
      variable declarations where applicable.  Also, a few fixes to 
      TryToFixInvalidVariablyModifiedType for issues that this exposed.
      
      llvm-svn: 65500
      adf40d4b
  5. Feb 25, 2009
Loading