Skip to content
  1. Nov 22, 2008
    • Chris Lattner's avatar
      Split the DiagnosticInfo class into two disjoint classes: · 427c9c17
      Chris Lattner authored
      one for building up the diagnostic that is in flight (DiagnosticBuilder)
      and one for pulling structured information out of the diagnostic when
      formatting and presenting it.
      
      There is no functionality change with this patch.
      
      llvm-svn: 59849
      427c9c17
  2. Nov 20, 2008
  3. Nov 19, 2008
  4. Nov 18, 2008
    • Chris Lattner's avatar
      start converting Sema over to using its canonical Diag method. · 377d1f8e
      Chris Lattner authored
      llvm-svn: 59561
      377d1f8e
    • Chris Lattner's avatar
    • Chris Lattner's avatar
      This reworks some of the Diagnostic interfaces a bit to change how diagnostics · 8488c829
      Chris Lattner authored
      are formed.  In particular, a diagnostic with all its strings and ranges is now
      packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a 
      ton of random stuff.  This has the benefit of simplifying the interface, making
      it more extensible, and allowing us to do more checking for things like access
      past the end of the various arrays passed in.
      
      In addition to introducing DiagnosticInfo, this also substantially changes how 
      Diagnostic::Report works.  Instead of being passed in all of the info required
      to issue a diagnostic, Report now takes only the required info (a location and 
      ID) and returns a fresh DiagnosticInfo *by value*.  The caller is then free to
      stuff strings and ranges into the DiagnosticInfo with the << operator.  When
      the dtor runs on the DiagnosticInfo object (which should happen at the end of
      the statement), the diagnostic is actually emitted with all of the accumulated
      information.  This is a somewhat tricky dance, but it means that the 
      accumulated DiagnosticInfo is allowed to keep pointers to other expression 
      temporaries without those pointers getting invalidated.
      
      This is just the minimal change to get this stuff working, but this will allow
      us to eliminate the zillions of variant "Diag" methods scattered throughout
      (e.g.) sema.  For example, instead of calling:
      
        Diag(BuiltinLoc, diag::err_overload_no_match, typeNames,
             SourceRange(BuiltinLoc, RParenLoc));
      
      We will soon be able to just do:
      
        Diag(BuiltinLoc, diag::err_overload_no_match)
            << typeNames << SourceRange(BuiltinLoc, RParenLoc));
      
      This scales better to support arbitrary types being passed in (not just 
      strings) in a type-safe way.  Go operator overloading?!
      
      llvm-svn: 59502
      8488c829
    • Chris Lattner's avatar
      Change the diagnostics interface to take an array of pointers to · 16ba9139
      Chris Lattner authored
      strings instead of array of strings.  This reduces string copying
      in some not-very-important cases, but paves the way for future 
      improvements.
      
      llvm-svn: 59494
      16ba9139
  5. Nov 17, 2008
  6. Nov 12, 2008
    • Douglas Gregor's avatar
      Implement support for operator overloading using candidate operator · a11693bc
      Douglas Gregor authored
      functions for built-in operators, e.g., the builtin
      
        bool operator==(int const*, int const*)
      
      can be used for the expression "x1 == x2" given:
      
        struct X {
          operator int const*();
        } x1, x2;
      
      The scheme for handling these built-in operators is relatively simple:
      for each candidate required by the standard, create a special kind of
      candidate function for the built-in. If overload resolution picks the
      built-in operator, we perform the appropriate conversions on the
      arguments and then let the normal built-in operator take care of it. 
      
      There may be some optimization opportunity left: if we can reduce the
      number of built-in operator overloads we generate, overload resolution
      for these cases will go faster. However, one must be careful when
      doing this: GCC generates too few operator overloads in our little
      test program, and fails to compile it because none of the overloads it
      generates match.
      
      Note that we only support operator overload for non-member binary
      operators at the moment. The other operators will follow.
      
      As part of this change, ImplicitCastExpr can now be an lvalue.
      
      llvm-svn: 59148
      a11693bc
  7. Nov 11, 2008
  8. Nov 08, 2008
  9. Nov 04, 2008
  10. Oct 24, 2008
  11. Oct 14, 2008
    • Daniel Dunbar's avatar
      Add Sema implementation of #pragma pack stack. · 5460374c
      Daniel Dunbar authored
       - Follows the MSVC (original) implementation, including support of
         pack(show) (useful for testing).
       - Implements support for named pack records which gcc seems to
         ignore (or implements incorrectly).
       - Not currently wired to anything, only functionality change is the
         type checking of the pragma.
      
      llvm-svn: 57476
      5460374c
  12. Oct 02, 2008
  13. Sep 09, 2008
  14. Sep 05, 2008
    • Ted Kremenek's avatar
      Remove "NextDecl" from RecordDecl. This change touches many files that where... · 47923c7e
      Ted Kremenek authored
      Remove "NextDecl" from RecordDecl.  This change touches many files that where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration.
      
      The motivation behind this change is that chaining the RecordDecls is simply unnecessary.  Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType.
      
      llvm-svn: 55821
      47923c7e
  15. Sep 04, 2008
  16. Sep 03, 2008
    • Steve Naroff's avatar
      Add semantic analysis for "blocks". · c540d669
      Steve Naroff authored
      Highlights...
      
      - 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr.
      - Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt().
      
      Next steps...
      
      - hack Sema::ActOnIdentifierExpr() to deal with block decl refs.
      - add attribute handler for byref decls.
      - add test cases.
      
      llvm-svn: 55710
      c540d669
  17. Aug 24, 2008
  18. Aug 23, 2008
  19. Aug 15, 2008
    • Daniel Dunbar's avatar
      Change Parser & Sema to use interned "super" for comparions. · 12c9ddce
      Daniel Dunbar authored
       - Added as private members for each because it is not clear where to
         put the common definition. Perhaps the IdentifierInfos all of these
         "pseudo-keywords" should be collected into one place (this would
         KnownFunctionIDs and Objective-C property IDs, for example).
      
      Remove Token::isNamedIdentifier.
       - There isn't a good reason to use strcmp when we have interned
         strings, and there isn't a good reason to encourage clients to do
         so.
      
      llvm-svn: 54794
      12c9ddce
  20. Aug 11, 2008
    • Daniel Dunbar's avatar
      More #include cleaning · 56fdb6ae
      Daniel Dunbar authored
       - 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
      56fdb6ae
    • Daniel Dunbar's avatar
      More #include cleaning · 6e8aa537
      Daniel Dunbar authored
       - Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
       - Moved Sema::getCurMethodDecl() out of line (dependent on
         ObjCMethodDecl via dyn_cast).
      
      llvm-svn: 54629
      6e8aa537
    • Daniel Dunbar's avatar
      More #include cleaning · 221fa94e
      Daniel Dunbar authored
       - Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
         SourceLocation.h)
       - Move ASTContext constructor into implementation
      
      llvm-svn: 54627
      221fa94e
  21. Jul 27, 2008
  22. Jul 25, 2008
  23. Jul 21, 2008
    • Chris Lattner's avatar
      Switch initialization of the protocol list for an interface decl to use · ca1e8485
      Chris Lattner authored
      the standard "set these as the list of protocols" interface instead of a 
      strange "set this as the size and then set each one to the value" interface.
      The problem with the later is that it a) is completely different from 
      everything else, b) is awkward, and c) doesn't handle the case when a
      referenced protocol is invalid: it set it to null.
      
      This meant that all clients downstream would have to handle null protocols
      in the protocol list, and empirically they didn't.  Fix this by not setting
      invalid protocols in the referenced protocol list, fixing the crash on 
      test/Sema/objc-interface-1.m
      
      While I'm at it, clean up some locations so that we produce:
      
      t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
      @interface NSWhatever : NSObject <NSCopying>
      ~~~~~~~~~~~~~~~~~~~~~   ^
      
      instead of:
      
      t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
      @interface NSWhatever : NSObject <NSCopying>
      ^
      
      llvm-svn: 53846
      ca1e8485
    • Chris Lattner's avatar
      improve comments yet again, now I know what this does :) · 530315fe
      Chris Lattner authored
      llvm-svn: 53821
      530315fe
    • Chris Lattner's avatar
      minor rename, also, reject pointer to qualified id. · 6886f383
      Chris Lattner authored
      id<NSCopyable>*  is not an "objc pointer type", id<NSCopyable> is.
      
      llvm-svn: 53820
      6886f383
Loading