Skip to content
  1. 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
  2. Jul 16, 2007
  3. Jul 14, 2007
  4. Jul 13, 2007
  5. 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
  6. Jun 22, 2007
  7. 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
  8. Jun 03, 2007
  9. 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
  10. May 24, 2007
  11. 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
  12. May 21, 2007
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. Mar 26, 2007
  19. 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
  20. 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
  21. 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
  22. 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
  23. Feb 26, 2007
  24. 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
  25. 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
  26. Jan 27, 2007
  27. Jan 26, 2007
Loading