Skip to content
  1. Mar 23, 2007
    • Steve Naroff's avatar
      Bug #: · f1e53698
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      
      Type Checking...round 2. This checkin "breaks" parsing carbon.h. I imagine
      that this will be true for the next week or so. Nevertheless, this round of
      changes includes the following:
      
      - Hacked various Expr classes to pass the appropriate TypeRef. Still have
      a few more classes to touch.
      - Implement type checking for ParseArraySubscriptExpr and ParseMemberReferenceExpr.
      - Added a debug hook to derive the class name for Stmt/Expr nodes. Currently a
      linear search...could easily optimize if important.
      - Changed the name of TaggedType->TagType. Now we have TagType and TagDecl (which
      are easier to remember).
      - Fixed a bug in StringLiteral conversion I did a couple weeks ago. hadError was
      not initialized (oops).
      - changed Sema::Diag to return true. This streamlines the type checking code
      considerably.
      - Added many diagnositics.
      
      This should be it!
      
      llvm-svn: 39361
      f1e53698
  2. Mar 16, 2007
    • 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
  3. Mar 14, 2007
    • 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
  4. Feb 28, 2007
    • 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
  5. Feb 26, 2007
  6. 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
  7. Jan 28, 2007
    • Chris Lattner's avatar
      Add support for target-independent builtin functions (like __builtin_abs), · 9561a0b3
      Chris Lattner authored
      whose decl objects are lazily created the first time they are referenced.
      Builtin functions are described by the clang/AST/Builtins.def file, which
      makes it easy to add new ones.
      
      This is missing two important pieces:
      1. Support for the rest of the gcc builtins.
      2. Support for target-specific builtins (e.g. __builtin_ia32_emms).
      
      Just adding this builtins reduces the number of implicit function definitions
      by 6, reducing the # diagnostics from 550 to 544 when parsing carbon.h.
      
      I need to add all the i386-specific ones to eliminate several hundred more.
      ugh.
      
      llvm-svn: 39327
      9561a0b3
  8. Jan 27, 2007
  9. Jan 26, 2007
  10. Jan 23, 2007
  11. Jan 22, 2007
  12. Dec 03, 2006
  13. Dec 02, 2006
    • Chris Lattner's avatar
      implement AST representation for function types with and without a prototype. · c6ad8131
      Chris Lattner authored
      This lets us pretty print stuff like this:
      
      void foo() {
        int X;
        X = sizeof(void (*(*)())());
        X = sizeof(int(*)(int, float, ...));
        X = sizeof(void (*(int arga, void (*argb)(double Y)))(void* Z));
      
      as:
      
        X = sizeof(void (*(*)())())
        X = sizeof(int (*)(int, float, ...))
        X = sizeof(void (*(int, void (*)(double)))(void *))
      
      Ah the wonders of 'modern' C syntax!
      
      llvm-svn: 39232
      c6ad8131
  14. Nov 20, 2006
  15. Nov 12, 2006
  16. Nov 11, 2006
  17. Nov 10, 2006
  18. Oct 25, 2006
  19. Oct 16, 2006
  20. Aug 17, 2006
  21. Jul 29, 2006
  22. Jul 04, 2006
Loading