Skip to content
  1. Oct 17, 2007
  2. Oct 16, 2007
  3. Oct 15, 2007
    • Steve Naroff's avatar
      · 126b4d83
      Steve Naroff authored
      Fix a parser bug with message expressions - need to call ParsePostfixExpressionSuffix(). 
      
      Now were correctly allow the following...
      
          i = [str rangeOfString:@"]"].length;
      
      llvm-svn: 43012
      126b4d83
    • 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
    • Steve Naroff's avatar
      · 27164362
      Steve Naroff authored
      Teach the type checker about "id". This removes the following bogus warning...
      
      [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.m
      t.m:29:18: warning: incompatible pointer types assigning 'id' to 'NSString *'
          resultString = [[NSString alloc] initWithFormat:0 arguments:0];
          ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      llvm-svn: 42975
      27164362
    • Anders Carlsson's avatar
      Add support for Pascal strings. · cbfc4b88
      Anders Carlsson authored
      llvm-svn: 42974
      cbfc4b88
    • Anders Carlsson's avatar
      Fix a warning · b30f47a8
      Anders Carlsson authored
      llvm-svn: 42973
      b30f47a8
    • 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
  4. 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
      · e7ed06e6
      Steve Naroff authored
      Fix -ast-dump for ObjC.
      
      llvm-svn: 42967
      e7ed06e6
    • 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
  5. Oct 13, 2007
Loading