Skip to content
  1. Mar 16, 2007
    • Steve Naroff's avatar
      Bug #: · 97035855
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Down to 0 warning/errors for Carbon.h. Also made a couple trivial name
      changes...
      
      llvm-svn: 39358
      97035855
    • Steve Naroff's avatar
      Bug #: · 6fbf0dcb
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      carbon.h looking good! Only 1 warning left...no parse errors!
      
      This fixes 3 bugs...
      - A couple tricky bugs with type canonicalization. Nested typedef's  weren't being
      handled properly. For example, the following didn't work:
      
      typdef int __darwin_pid_t;
      typedef __darwin_pid_t pid_t;
      
      int getpgid(pid_t);
      int getpgid(int);
      
      - The storage class wasn't being preserved. As a result, Sema was complaining
      about the  following:
      
      extern char *foo;
      char *foo;
      
      - various built-ins weren't registered...resulting in spurious warnings.
      
      llvm-svn: 39357
      6fbf0dcb
  2. Mar 14, 2007
    • Steve Naroff's avatar
      Bug #: · 3273c228
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      This is a "small" checkin.  #include_next wasn't working properly on
      Leopard. This is because the driver has some hard coded paths that
      don't work on Leopard. The real fix is to derive them, however I don't
      think we need to solve this now. At this point, anyone working on clang
      should be able to use Leopard. This fix removed 11 errors processing
      "carbon.h". The bug that bubbles up to the top is in MergeFunctionDecl().
      As part of digging into this part of Sema, I rearranged some methods
      (and changed the visibility).
      
      llvm-svn: 39356
      3273c228
    • Steve Naroff's avatar
      Bug #: · b7d4924e
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Added size expression to ArrayType. This was needed to implement
      Type::isIncompleteType(). At the moment, there is no support for
      determining if we have a constant expression (which won't be too
      difficult now that we have support for literal parsing/ast's).
      Nevertheless, the parser will allow "struct foo { int a[b]; }"
      (which is illegal). There is still significant work to fully analyze
      array types. The good news is "carbon.h" goes from 288 bogus errors
      down to 26!
      
      llvm-svn: 39355
      b7d4924e
  3. Mar 13, 2007
    • Steve Naroff's avatar
      Bug #: · 4f88b311
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Move string literal parsing from Sema=>LiteralSupport. This consolidates
      all the quirky parsing code within the Lexer subsystem (yeah!). This
      simplifies Sema and (more importantly) allows future parsers
      (i.e. subclasses of Action) to benefit from this code.
      
      llvm-svn: 39354
      4f88b311
    • Steve Naroff's avatar
      Bug #: · f2fb89e7
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Misc. cleanup/polish of NumericLiteralParser and it's two clients, the
      C preprocessor and AST builder...
      
      llvm-svn: 39353
      f2fb89e7
    • Steve Naroff's avatar
      Bug #: · 451d8f16
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      -Converted the preprocessor to use NumericLiteralParser.
      -Several minor changes to LiteralSupport interface/implementation.
      -Added an error diagnostic for floating point usage in pp expr's.
      
      llvm-svn: 39352
      451d8f16
  4. Mar 10, 2007
    • Steve Naroff's avatar
      Bug #: · 09ef4741
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Moved numeric literal support from SemaExpr.cpp to LiteralSupport.[h,cpp]
      in Lex. This will allow it to be used by both Sema and Preprocessor (and
      should be the last major refactoring of this sub-system).. Over
      time, it will be reused by anyone implementing an actions module (i.e.
      any subclass of llvm::clang::Action. Minor changes to IntegerLiteral in Expr.h.
      More to come...
      
      llvm-svn: 39351
      09ef4741
  5. Mar 07, 2007
    • Steve Naroff's avatar
      Bug #: · cf30755a
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Refactored ParseNumericConstant using SkipDigits and friends. This
      cleaned up the code and removed many "breaks". In the process, I found
      several bugs that needed to be fixed (proof that this refactoring had
      real value, not simply aesthetics). Also simplified error handling logic
      and removed an unused error condition from Diagnostics.def.
      
      llvm-svn: 39350
      cf30755a
  6. Mar 06, 2007
    • Steve Naroff's avatar
      Bug #: · 8160ea20
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      More code to parse numeric constants. This checkin includes:
      - Feedback from Chris.
      - Support for parsing floating point constants.
      - Moved the code to "Sema". Changed API in Action.
      - More/better error diagnostics.
      
      At this point, the parsing support should be largely complete. Next step
      is to work on filling in sensible values (in IntegerLiteral/FloatLiteral).
      
      llvm-svn: 39349
      8160ea20
  7. Feb 28, 2007
    • Steve Naroff's avatar
      · 2c055d2b
      Steve Naroff authored
      Go back to having the clang driver create ASTContext explicitly, passing
      it to Sema/ASTStreamer (separating the lifetime of ASTContext from
      the lifetime of Sema). One day it might be useful to consider creating
      a context object implicitly if one isn't provided (using default arguments in
      Sema's constructor). At this point, adding this convenience isn't necessary.
      
      llvm-svn: 39346
      2c055d2b
    • Steve Naroff's avatar
      Make Sema's use of the preprocessor explicit (rather than assume · 38d31b47
      Steve Naroff authored
      the prerocessor will be available via ASTContext).
      - Removed the public data member "PP" in ASTContext.
      - Changed ASTContext's contructor to take TargetInfo/IdentifierTable explicitly.
      - Implicitly create an ASTContext in Sema's constructor. This simplifies
      the clients job (and makes ASTContext more private).
      --As a side effect, added a "PrintStats" hook to Sema.
      
      To support this level of encapsulation, ASTContext is always dynamically
      allocated (by Sema). Previously, ASTContext was being allocated on the
      stack. I don't believe this should be a performance issue (since ASTContext
      is fairly course grain and tied to the lifetime of Sema currently).
      
      llvm-svn: 39345
      38d31b47
  8. Feb 27, 2007
    • Steve Naroff's avatar
      More changes to complete the dynamic type support for Stmt/Expr. · 7f890eb7
      Steve Naroff authored
      This set of changes includes:
      - convert ExprCXX.h and add to the Xcode project file.
      -- required adding CXXBoolLiteralExpr to StmtNodes.def.
      -- required adding visitor support (decl/defn).
      - make the class codes in StmtNodes.def explicit (to enable range checking).
      -- this required changing all clients of the STMT macro.
      - declare the instance data const.
      
      llvm-svn: 39344
      7f890eb7
  9. Feb 26, 2007
  10. Feb 22, 2007
  11. Feb 21, 2007
  12. Feb 13, 2007
  13. Feb 11, 2007
  14. Jan 31, 2007
  15. Jan 29, 2007
    • Chris Lattner's avatar
      Add support for target-specific builtins, including detecting nonportability · 10a5b387
      Chris Lattner authored
      of source code.  For example:
      
      $ clang INPUTS/carbon_h.c -arch i386 -arch ppc
      prints:
      ...
      /usr/lib/gcc/i686-apple-darwin8/4.0.1/include/mmintrin.h:51:3: note: use of a target-specific builtin function, source is not 'portable'
        __builtin_ia32_emms ();
        ^
      
      because carbon.h pulls in xmmintrin.h, and __builtin_ia32_emms isn't a builtin on ppc.
      
      Though clang now supports target-specific builtins, the full table isn't implemented yet.
      
      llvm-svn: 39328
      10a5b387
  16. Jan 28, 2007
  17. Jan 27, 2007
  18. Jan 26, 2007
  19. Jan 25, 2007
    • Chris Lattner's avatar
      Reject: · e5a6656b
      Chris Lattner authored
      struct q { int a, a; };
      
      with:
      
      t.c:3:19: error: duplicate member 'a'
      struct q { int a, a; };
                        ^
      t.c:3:16: error: previous definition is here
      struct q { int a, a; };
                     ^
      
      llvm-svn: 39303
      e5a6656b
    • Chris Lattner's avatar
      Register enumconstantdecls in their appropriate scope and check for conflicts. · 8116d1b5
      Chris Lattner authored
      This emits these diagnostics:
      
      t.c:4:14: error: redefinition of 'a'
      enum foo22 { a, b };
                   ^
      t.c:3:5: error: previous definition is here
      int a;
          ^
      t.c:8:17: error: redefinition of enumerator 'b'
      enum foo23 { c, b };
                      ^
      t.c:4:17: error: previous definition is here
      enum foo22 { a, b };
                      ^
      4 diagnostics generated.
      
      
      for:
      
      int a;
      enum foo22 { a, b };
      enum foo23 { c, b };
      
      llvm-svn: 39302
      8116d1b5
Loading