Skip to content
  1. Oct 19, 2007
  2. Oct 18, 2007
    • Steve Naroff's avatar
      · 1bb21df4
      Steve Naroff authored
      Tweak a recent fix to UsualArithmeticConversions (made by Chris - r43113). The benefit of this tweak is it guarantees the entire routine operates on unqualified types (which I believe is a bit clearer).  
      
      llvm-svn: 43142
      1bb21df4
    • Steve Naroff's avatar
      · a78c464c
      Steve Naroff authored
      Fix a bug in Sema::CheckConditionalOperands(). When mixing pointers and null pointer constants, we need to promote the null pointer constant (which is an integer) to the pointer type. Test case is self explanatory.
      
      This surfaced yesterday, when compiling test/Sema/cocoa.m on Leopard. Since this has nothing to do with ObjC, it's kind of bizarre this hasn't shown up before. I imagine Cocoa.h on Leopard may have changed recently? 
      
      Thanks to Ted for localizing the bug and giving me a useful AST dump...
      
      llvm-svn: 43114
      a78c464c
    • Chris Lattner's avatar
      UsualArithmeticConversions is crashing with an assert · fac7ac41
      Chris Lattner authored
      when comparing "float" and "const float".  This "fixes" the
      issue, but may not be the right fix.  Steve, please review.
      
      Testcase here: test/Sema/usual-float.c
      
      llvm-svn: 43113
      fac7ac41
    • Steve Naroff's avatar
      · 8569d773
      Steve Naroff authored
      Fix the following bug...
      
      unsigned char asso_values[] = { 34 };
      int legal2() { 
        return asso_values[0]; 
      }
      
      The code that creates the new constant array type was operating on the original type.
      
      As a result, the constant type being generated was "unsigned char [1][]" (which is wrong).
      
      The fix is to operate on the element type - in this case, the correct type is "unsigned char [1]"
      
      I added this case to array-init.c, which clearly didn't catch this bogosity...
      
      llvm-svn: 43112
      8569d773
  3. Oct 17, 2007
  4. Oct 16, 2007
    • Fariborz Jahanian's avatar
      Patch to diagnose duplicate method implementations. · ebac2cb2
      Fariborz Jahanian authored
      llvm-svn: 43046
      ebac2cb2
    • Steve Naroff's avatar
      · d2754264
      Steve Naroff authored
      Remove ObjcMethodDecl::getNumMethodParams/getMethodParamDecl, they aren't used/needed.
      Change ObjcMethodDecl::getMethodType to getResultType, to match FunctionDecl.
      
      llvm-svn: 43045
      d2754264
    • Fariborz Jahanian's avatar
      4bef462a
    • Steve Naroff's avatar
      · 55f52da2
      Steve Naroff authored
      Emit diagnostics for methods not found.
      
      llvm-svn: 43037
      55f52da2
    • Chris Lattner's avatar
      initialization of references should not do default fn/array promotions. · e6dcd505
      Chris Lattner authored
      This fixes a bug Anders noticed.
      
      llvm-svn: 43024
      e6dcd505
    • Steve Naroff's avatar
      · 69849552
      Steve Naroff authored
      Bad cast...need to use dyn_cast_or_null. Also changed Sema::InitBuiltinVaListType (which had the same bug).
      
      llvm-svn: 43023
      69849552
    • Steve Naroff's avatar
      · f73b784a
      Steve Naroff authored
      Change the type of ObjCStringLiteral from "struct __builtin_CFString *" to "NSConstantString *".
      
      This makes the typecheck much happier. Without this change, the type checker would have to special case "struct __builtin_CFString *". This change does assume the interface for NSConstantString is declared in the translation unit.
      
      I left ASTContext::getCFConstantStringType() around for now (with a comment that says it is currently unused).
      
      llvm-svn: 43021
      f73b784a
  5. Oct 15, 2007
    • Steve Naroff's avatar
      · 32e44c00
      Steve Naroff authored
      Move type compatibility predicates from Type to ASTContext. In addition, the predicates are now instance methods (they were previously static class methods on Type).
      
      This allowed me to fix the following hack from this weekend...
      
      // FIXME: Devise a way to do this without using strcmp.
      // Would like to say..."return getAsStructureType() == IdStructType;", but
      // we don't have a pointer to ASTContext.
      bool Type::isObjcIdType() const {
        if (const RecordType *RT = getAsStructureType())
          return !strcmp(RT->getDecl()->getName(), "objc_object");
        return false;
      }
      
      ...which is now...
      
      bool isObjcIdType(QualType T) const {
        return T->getAsStructureType() == IdStructType;
      }
      
      Side notes:
      
      - I had to remove a convenience function from the TypesCompatibleExpr class.
      
      int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);}
      
      Which required a couple clients get a little more verbose...
      
      -    Result = TCE->typesAreCompatible();
      +    Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2());
      
      Overall, I think this change also makes sense for a couple reasons...
      
      1) Since ASTContext vends types, it makes sense for the type compatibility API to be there.
      2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions).
      
      llvm-svn: 43009
      32e44c00
    • Anders Carlsson's avatar
      Add code generation and sema checking for __builtin_va_arg. · 7e13ab88
      Anders Carlsson authored
      llvm-svn: 43006
      7e13ab88
    • Fariborz Jahanian's avatar
      d4b3015d
    • Steve Naroff's avatar
      · 66e9f331
      Steve Naroff authored
      Added ASTContext::setObjcIdType/getObjcIdType(), set by Sema.
      
      Also noticed ASTContext::BuiltinVaListType wasn't being initialized to the null type (so I set it).
      
      llvm-svn: 42983
      66e9f331
    • Anders Carlsson's avatar
      Add support for Pascal strings. · cbfc4b88
      Anders Carlsson authored
      llvm-svn: 42974
      cbfc4b88
    • Steve Naroff's avatar
      · 5d152544
      Steve Naroff authored
      - Teach ObjcInterfaceDecl::lookupInstance/ClassMethod to look through protocols.
      - Start looking up methods in the global method pools (for "id").
      - Start integrating interface types into the type system.
      
      llvm-svn: 42971
      5d152544
  6. Oct 14, 2007
    • Steve Naroff's avatar
      · ca0ecfe0
      Steve Naroff authored
      Add category lookup (removing a couple FIXME's).
      Changed ObjcInterfaceDecl::ListCategories->CategoryList.
      
      llvm-svn: 42968
      ca0ecfe0
    • Steve Naroff's avatar
      · 5811baf1
      Steve Naroff authored
      - Added Sema::AddFactoryMethodToGlobalPool and Sema::AddInstanceMethodToGlobalPool and DenseMaps. This will allow us to efficiently lookup a method from a selector given no type information (for the "id" data type).
      
      - Fixed some funky "}
                          else {" indentation in Sema::ActOnAddMethodsToObjcDecl(). I'd prefer we stay away from this style...it wastes space and isn't any easier to read (from my perspective, at least:-)
      
      - Changed Parser::ParseObjCInterfaceDeclList() to only call Action::ActOnAddMethodsToObjcDecl() when it actually has methods to add (since most interface have methods, this is a very minor cleanup).
      
      llvm-svn: 42957
      5811baf1
  7. Oct 13, 2007
  8. Oct 12, 2007
Loading