Skip to content
  1. Aug 28, 2007
  2. Aug 27, 2007
    • Chris Lattner's avatar
      constify some stuff · 8f63b9d5
      Chris Lattner authored
      llvm-svn: 41503
      8f63b9d5
    • Chris Lattner's avatar
      implement sizeof(enum x), patch inspired by Keith Bauer. · a9e7961a
      Chris Lattner authored
      llvm-svn: 41500
      a9e7961a
    • Steve Naroff's avatar
      Replaced ASTContext::maxFloatingType() with ASTContext::compareFloatingType(). · 7af82d46
      Steve Naroff authored
      Changed Sema::UsualArithmeticConversions to use the new API.
      
      This fixes the following case...
      
      _Complex double X;
      double y;
      
      void foo() {
        X = X + y;
      }
      
      [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang complex.c -parse-ast-dump
      Read top-level variable decl: 'X'
      Read top-level variable decl: 'y'
      
      void foo()
      (CompoundStmt 0x2605cc0
        (BinaryOperator 0x2605ca0 '_Complex double' '='
          (DeclRefExpr 0x2605c10 '_Complex double' Decl='X' 0x2605ab0)
          (BinaryOperator 0x2605c80 '_Complex double' '+'
            (DeclRefExpr 0x2605c30 '_Complex double' Decl='X' 0x2605ab0)
            (ImplicitCastExpr 0x2605c70 '_Complex double'
              (DeclRefExpr 0x2605c50 'double' Decl='y' 0x2605ae0)))))
      
      llvm-svn: 41483
      7af82d46
    • Steve Naroff's avatar
      · fc6ffa25
      Steve Naroff authored
      Tweak a comment and assert.
      
      llvm-svn: 41475
      fc6ffa25
    • Steve Naroff's avatar
      · 9091ef70
      Steve Naroff authored
      Replaced ASTContext::maxComplexType() with ASTContext::getFloatingTypeOfSizeWithinDomain().
      
      Changed Sema::UsualArithmeticConversions to correctly implement complex/float conversions, 
      using maxFloatingType() with getFloatingTypeOfSizeWithinDomain().
      
      llvm-svn: 41474
      9091ef70
  3. Aug 17, 2007
  4. Aug 01, 2007
    • Steve Naroff's avatar
      · a773cd5d
      Steve Naroff authored
      Add comments to getTypeOfExpr/getTypeOfType.
      Also add instances of TypeOfExpr/TypeOfType to the Types vector (so we can keep track of them).
      
      llvm-svn: 40677
      a773cd5d
    • Steve Naroff's avatar
      · 236becbb
      Steve Naroff authored
      Two typeof() related changes...
      
      - Changed the name of ASTContext::getTypeOfType(Expr*)->getTypeOfExpr().
      - Remove FIXME for TypeOfExpr::getAsStringInternal(). This will work fine for printing the AST. It isn't ideal
      for error diagnostics (since it's more natural to display the expressions type). 
      
      One "random" (or at least delayed:-) change...
      
      - Changed all "ext_typecheck_*" diagnostics from EXTENSION->WARNING. Reason: Since -pedantic is now
      off (by default), these diagnostics were never being emitted (which is bad). With this change, clang will
      emit the warning all the time. The only downside (wrt GCC compatibility) is -pedantic-errors will not turn
      this diagnostics into errors (a "feature" of making tagging them with EXTENSION). When/if this becomes
      an issue, we can revisit.
      
      llvm-svn: 40676
      236becbb
  5. Jul 31, 2007
    • Steve Naroff's avatar
      · ad373bdc
      Steve Naroff authored
      Add parsing and AST support for GNU "typeof".
      Many small changes to lot's of files.
      Still some FIXME's, however the basic support is in place.
      
      llvm-svn: 40631
      ad373bdc
  6. Jul 24, 2007
  7. Jul 20, 2007
  8. Jul 18, 2007
    • Chris Lattner's avatar
      implement sizeof/alignof support for structs, unions and complex. · 647fb226
      Chris Lattner authored
      This allows us to compile this:
      
      struct abc { char A; double D; };
      
      int foo() {
        return sizeof(struct abc);
        return __alignof__(struct abc);
      }
      
      Into:
      
              ret i32 16
              ret i32 8
      
      llvm-svn: 40010
      647fb226
    • Steve Naroff's avatar
      · 91fcddb5
      Steve Naroff authored
      First round of extended vector support. Here is an overview...
      
      - added ocu_vector_type attribute, Sema::HandleOCUVectorTypeAttribute(). 
      - added new AST node, OCUVectorType, a subclass of VectorType.
      - added ASTContext::getOCUVectorType.
      - changed ASTContext::convertToVectorType() to ASTContext::getVectorType(). This is 
      unrelated to extended vectors, however I was in the vicinity and it was on my todo list.
      Added a FIXME to Sema::HandleVectorTypeAttribute to deal with converting complex types.
      
      llvm-svn: 40007
      91fcddb5
    • Chris Lattner's avatar
      initial layout support for structures and unions. This isn't actually · 53cfe804
      Chris Lattner authored
      hooked up to anything, so it's not very useful yet.
      
      llvm-svn: 40006
      53cfe804
    • Chris Lattner's avatar
      teach -stats about new types · 9c016770
      Chris Lattner authored
      llvm-svn: 39996
      9c016770
  9. Jul 16, 2007
  10. Jul 14, 2007
  11. Jul 13, 2007
  12. Jul 07, 2007
    • Steve Naroff's avatar
      Bug #: · 4ae0ac6a
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      - Finished semantic analysis for vectors, added some diagnostics.
      - Added AST for vectors (instantiation, installation into the decl).
      - Fixed bug in ParseArraySubscriptExpr()...this crasher was introduced by me
      when we added the range support.
      - Turned pedantic off by default. Since vectors are gcc extensions, having
      pedantic on by default was annoying. Turning it off by default is  also
      consistent with gcc (but this wasn't my primary motivation).
      - Tweaked some comments and diagnostics.
      
      Note: The type checking code is still under construction (for vectors). This
      will be my next check-in.
      
      llvm-svn: 39715
      4ae0ac6a
  13. Jun 22, 2007
  14. Jun 16, 2007
    • Chris Lattner's avatar
      Finally bite the bullet and make the major change: split the clang namespace · 23b7eb67
      Chris Lattner authored
      out of the llvm namespace.  This makes the clang namespace be a sibling of
      llvm instead of being a child.
      
      The good thing about this is that it makes many things unambiguous.  The
      bad things is that many things in the llvm namespace (notably data structures
      like smallvector) now require an llvm:: qualifier.  IMO, libsystem and libsupport
      should be split out of llvm into their own namespace in the future, which will fix
      this issue.
      
      llvm-svn: 39659
      23b7eb67
  15. Jun 03, 2007
  16. May 27, 2007
    • Bill Wendling's avatar
      Bug #: · 3708c185
      Bill Wendling authored
      Submitted by: Bill Wendling
      Reviewed by: Chris Lattner
      
      - Initial support for C++ references. Adding to the AST and Parser.
        Skeletal support added in the semantic analysis portion. Full semantic
        analysis is to be done soon.
      
      llvm-svn: 39496
      3708c185
  17. May 24, 2007
  18. May 23, 2007
    • Steve Naroff's avatar
      Bug #: · f84d11f9
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Added "global" statistics gathering for Decls/Stmts/Exprs.
      Very useful for working with a single file. When we start compiling
      multiple files, will need to enhance this to collect stats on a per-module
      basis.
      
      llvm-svn: 39485
      f84d11f9
  19. May 21, 2007
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
Loading