Skip to content
  1. Apr 28, 2007
    • Steve Naroff's avatar
      Bug #: · 85d23e3e
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Minor change to assert logic.
      
      llvm-svn: 39422
      85d23e3e
  2. Apr 27, 2007
    • Steve Naroff's avatar
      Bug #: · 0af91209
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      - Disabled -pedantic for now (until it ignores system headers).
      - Removed convertSignedWithGreaterRankThanUnsigned() and convertFloatingRankToComplexType().
      The logic is now inlined in maxIntegerType and maxComplexType().
      - Removed getIntegerRank/getFloatingRank from the private interface. These
      are now really private helpers:-)
      - Declare maxIntegerType/maxFloatingType static. maxComplexType const.
      - Added an enum for the floating ranks.
      - Several fixed to getIntegerRank: add Bool, Char, and a clause for enums.
      
      llvm-svn: 39421
      0af91209
    • Steve Naroff's avatar
      Bug #: · e471889d
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      More typechecking, refactoring...
      - Implemented the following routines...CheckAdditiveOperands,
      CheckCommaOperands, CheckLogicalOperands.
      - Added maxComplexType, maxFloatingType, & maxIntegerType to ASTContext.
      Ranking helper functions moved to ASTContext as well (they are private:-)
      - Simplified UsualArithmeticConversions using the new ASTContext hooks.
      - Fixed isAssignmentOp()...is was preventing comma exprs from ever being created:-(
      - Changed a GCC compat extension to truly be an extension (and turned extensions
      on by default). This now produces a warning by default.
      
      llvm-svn: 39418
      e471889d
  3. Apr 06, 2007
    • Steve Naroff's avatar
      Bug #: · e5aa9be0
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      -Changed the name of TypeRef to QualType. Many diffs.
      -Changed the QualType constructor to require Quals be passed. This makes the code a bit
      more verbose, however will make the code easier to work on. Given the complexity
      of types, this should help spot bogosities.
      -Changed the Expr constructor to require a QualType. Same motivation.
      
      llvm-svn: 39395
      e5aa9be0
  4. Apr 05, 2007
    • Steve Naroff's avatar
      Bug #: · d50c88e4
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Fix "FIXME: does this lose qualifiers from the typedef??" in ASTContext::getTypedefType().
      
      This change was fairly pervasive...nevertheless, here are the highlights:
      - Change the type of Type::CanonicalType to TypeRef (was "Type *").
      - Change the implementation of TypeRef::getCanonicalType() to work for typedefs.
      - Make the implementation of Type::getCanonicalType private (only TypeRef should access). This
      will force clients to use TypeRef::getCanonicalType (the correct version of the function). Since
      TypeRef overloads "->", it was very easy to fall into this bug...
      - Changed many references of "Type *" to "TypeRef"...when the raw type pointer is required, use t.getTypePtr().
      - Changed all the *Type classes to take a TypeRef.
      - Made the Type constructor protected (cleanup).
      - Removed function Expr::getType().
      - Convert functions in SemaExpr to use the above support. This fixed the "const" bug I was originally investigating.
      
      I will follow this check-in up with a rename of TypeRef->QualType. I will also make sure the constructor does not default to 0 (which can lead to broken code...).
      
      llvm-svn: 39394
      d50c88e4
  5. Apr 03, 2007
    • Steve Naroff's avatar
      Bug #: · 0f6256d0
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      declare getSizeType() const and fix typo in comment...
      
      llvm-svn: 39376
      0f6256d0
    • Steve Naroff's avatar
      Bug #: · 92e30f8c
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Incorporate code review feedback from Chris...
      - minor restructure of ParseMemberReferenceExpr logic. The last statement
      is now the instantiation of the AST node (which I like a lot and will conform
      to throughout Sema).
      - declare StmtClassNameTable const.
      - reword an error diagnostic.
      - install the correct type for ParseSizeOfAlignOfTypeExpr. Added hook in
      ASTContext. For now, simply return Context.UnsignedLongTy. Added a FIXME
      to revisit (i.e. compute using TargetInfo).
      
      llvm-svn: 39374
      92e30f8c
  6. Mar 26, 2007
  7. 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
  8. 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
  9. 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
  10. 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
  11. Feb 26, 2007
  12. 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
  13. 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
  14. Jan 27, 2007
  15. Jan 26, 2007
  16. Jan 23, 2007
  17. Jan 22, 2007
  18. Dec 03, 2006
  19. 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
  20. Nov 20, 2006
  21. Nov 12, 2006
  22. Nov 11, 2006
  23. Nov 10, 2006
  24. Oct 25, 2006
  25. Oct 16, 2006
  26. Aug 17, 2006
  27. Jul 29, 2006
Loading