Skip to content
  1. Apr 25, 2007
    • Steve Naroff's avatar
      Bug #: · f633d091
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      A bunch of "small" changes...
      - Fixed a bug in ConvertFloatingRankToComplexType() that rendered it useless.
      ASTContext was being copied by default (as the result of declaring the argument
      incorrectly). Chris gave me the magic potion to disallow this in ASTContext.
      - Removed a tab:-)
      - Added some much needed comments to the float/complex promotion madness.
      - Improved some aesthetics (based on code review w/Chris).
      
      llvm-svn: 39414
      f633d091
    • Steve Naroff's avatar
      Bug #: · b01bbe3e
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Refactored code that deals with float/complex conversions (the previous commit).
      
      - Removed 6 predicates that identify the built-in float/complex types.
      - Added two helper functions GetFloatingRank() & ConvertFloatingRankToComplexType().
      At present, these are static functions in SemaExpr.cpp. Conceptually, they would be nice
      to move to Type, however there are layering problems with that (i.e. no ASTContext).
      Another possibility is to move them to ASTContext?
      - Simplified the logic in UsualArithmeticConversions() considerably.
      
      llvm-svn: 39413
      b01bbe3e
  2. Apr 24, 2007
    • Steve Naroff's avatar
      Bug #: · bf223ba1
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      -Lot's of detail work in UsualArithmeticConversion(). Needed to expand
      the code for dealing with floating types. This code still has a couple
      of FIXME's and could be refactored a bit.
      -Added a bunch of Type predicates to simplify the float conversions.
      Used the opportunity to convert a bunch of predicates to dyn_cast (it's cleaner
      when just dealing with Builtin types).
      
      llvm-svn: 39412
      bf223ba1
    • Steve Naroff's avatar
      Bug #: · 1926c836
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Lot's of changes related to type checking binary expressions.
      - Changed the name/proto of ImplicitConversion. It is now named UsualUnaryConversion - it takes a
      type and returns a type. This allowed me to remove the explicit node creation for array/function->pointer conversions.
      - Added function UsualArithmeticConversions().
      - Changed all the "Check" functions for binary ops. They use the new "Usual" functions above.
      - new predicates on Type, isSignedIntegerType()/isUnsignedIntegerType().
      - moved getDecl() out of the Sema class. It is now a static helper function in SemaExpr.cpp. It was also renamed getPrimaryDeclaration().
      - Added CheckArithmeticOperand() for consistency with the other unary "Check" functions.
      
      Should finish up the binary expressions tomorrow...with a small number of "FIXME's"
      
      llvm-svn: 39411
      1926c836
  3. Apr 21, 2007
    • Steve Naroff's avatar
      Bug #: · 5c10d4ba
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Start hacking on binary ops...
      Important bug fix...was ignoring the return value from ImplicitConversion.
      This didn't bother the type checking logic, however the AST was malformed.
      
      llvm-svn: 39410
      5c10d4ba
    • Steve Naroff's avatar
      Bug #: · 4b7ce03f
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      - Added Type::isPromotableIntegerType().
      - The unary operators are now largely complete (Sema::ParseUnaryOp and friends).
      - Implemented ImplicitConversion hook (was a stub).
      
      llvm-svn: 39409
      4b7ce03f
  4. Apr 20, 2007
    • Steve Naroff's avatar
      Bug #: · 4750051e
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Continue working on type checking for unary operators. Added:
      
      - Two 3 private functions to Sema: CheckAddressOfOperand(), CheckIndirectionOperand(),
      and getDecl().
      - Added Expr::isLvalue() - it was needed for CheckAddressOfOperand(). It will
      also be needed for ++/-- and the assignment operators.
      - Added a couple diagnostics for invalid lvalues (for & of).
      
      llvm-svn: 39408
      4750051e
  5. Apr 11, 2007
  6. Apr 10, 2007
  7. 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
  8. 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
    • Chris Lattner's avatar
      Add support for character constants in PP expressions, like: · f8a0b0fa
      Chris Lattner authored
      #if 'a'
      
      llvm-svn: 39393
      f8a0b0fa
    • Chris Lattner's avatar
      Implement support for semantic analysis of character constants. · 38004880
      Chris Lattner authored
      llvm-svn: 39392
      38004880
    • Chris Lattner's avatar
      wchar_t width is now expressed in terms of bits for uniformity. · d5a828b6
      Chris Lattner authored
      llvm-svn: 39391
      d5a828b6
    • Chris Lattner's avatar
      2f5add62
    • Chris Lattner's avatar
      add some more dummy target hooks · d2f5ec4e
      Chris Lattner authored
      llvm-svn: 39389
      d2f5ec4e
    • Chris Lattner's avatar
      Correctly represent and propagate signedness information in preprocessor · a9eac7ff
      Chris Lattner authored
      constant expressions.  This allows us to emit this diagnostic:
      
      t.c:5:5: warning: integer constant is so large that it is unsigned
      #if 12345678901234567890
          ^
      
      And makes constant evaluation fully correct, but we do not yet detect and
      warn about integer overflow.
      
      This patch requires cvs up'ing the main llvm tree to get the APSInt class,
      but no libraries need to be rebuilt there.
      
      llvm-svn: 39388
      a9eac7ff
  9. Apr 04, 2007
  10. 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 #: · 7840336c
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Avoid including "clang/AST/Expr.h" in Sema.h just to access
      UnaryOperator::Opcode. While the inclusion wasn't objectionable in terms
      of layering, it is nice to keep the inclusions as modest as possible.
      
      llvm-svn: 39375
      7840336c
Loading