- Oct 19, 2007
-
-
Chris Lattner authored
llvm-svn: 43188
-
Steve Naroff authored
Fix the previous (short lived:-) FIXME. I didn't realize that GCC considers this a hard error (I thought it was built-in). Since it's not, we should simply emit an error. [dylan:~/llvm/tools/clang] admin% cc -c trivial.m trivial.m:6: error: cannot find interface declaration for 'NSConstantString' [administrators-powerbook59:~/llvm/tools/clang] admin% ../../Debug/bin/clang trivial.m trivial.m:6:16: error: cannot find interface declaration for 'NSConstantString' NSString *s = @"123"; ^ 1 diagnostic generated. llvm-svn: 43157
-
Fariborz Jahanian authored
llvm-svn: 43155
-
Steve Naroff authored
Add a FIXME to an assert. Change a dyn_cast_or_null back to cast (which is more efficient). llvm-svn: 43152
-
Fariborz Jahanian authored
llvm-svn: 43151
-
- Oct 18, 2007
-
-
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
-
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
-
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
-
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
-
- Oct 17, 2007
-
-
Fariborz Jahanian authored
llvm-svn: 43075
-
Anders Carlsson authored
Generate code for static variables that don't have initializers. Also, report an error if a static initializer is not constant. llvm-svn: 43058
-
Fariborz Jahanian authored
llvm-svn: 43051
-
Steve Naroff authored
Add Sema::CheckMessageArgumentTypes()... llvm-svn: 43050
-
Chris Lattner authored
@selector probably gets this wrong also. llvm-svn: 43048
-
Chris Lattner authored
Rename SourceRange::Begin()/End() to getBegin()/getEnd() for consistency with other code. Start building the rewriter towards handling @encode. llvm-svn: 43047
-
- Oct 16, 2007
-
-
Fariborz Jahanian authored
llvm-svn: 43046
-
Steve Naroff authored
Remove ObjcMethodDecl::getNumMethodParams/getMethodParamDecl, they aren't used/needed. Change ObjcMethodDecl::getMethodType to getResultType, to match FunctionDecl. llvm-svn: 43045
-
Fariborz Jahanian authored
llvm-svn: 43038
-
Steve Naroff authored
Emit diagnostics for methods not found. llvm-svn: 43037
-
Chris Lattner authored
This fixes a bug Anders noticed. llvm-svn: 43024
-
Steve Naroff authored
Bad cast...need to use dyn_cast_or_null. Also changed Sema::InitBuiltinVaListType (which had the same bug). llvm-svn: 43023
-
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
-
- Oct 15, 2007
-
-
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
-
Anders Carlsson authored
llvm-svn: 43006
-
Fariborz Jahanian authored
llvm-svn: 43000
-
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
-
Anders Carlsson authored
llvm-svn: 42974
-
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
-
- Oct 14, 2007
-
-
Steve Naroff authored
Add category lookup (removing a couple FIXME's). Changed ObjcInterfaceDecl::ListCategories->CategoryList. llvm-svn: 42968
-
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
-
- Oct 13, 2007
-
-
Anders Carlsson authored
llvm-svn: 42939
-
Fariborz Jahanian authored
llvm-svn: 42938
-
Fariborz Jahanian authored
llvm-svn: 42936
-
- Oct 12, 2007
-
-
Ted Kremenek authored
printf format strings. Added type checking to see if the matching width/precision argument was of type 'int'. Thanks to Anders Carlsson for reporting this missing feature. llvm-svn: 42933
-
Fariborz Jahanian authored
llvm-svn: 42928
-
Fariborz Jahanian authored
ok class names and streamlined this logic to do the lookup once. llvm-svn: 42926
-
Steve Naroff authored
Replace one FIXME with another. We handle protocols just fine now. The ObjC decl will only be 0 when we have an error on the ObjC decl. I would prefer we pass in a decl that is marked as invalid. I don't think this is critical to fix now, however I'd like us to be consistent. There are currently many places that don't mark the decl as invalid (which need to be fixed)... llvm-svn: 42923
-
Anders Carlsson authored
llvm-svn: 42917
-
Fariborz Jahanian authored
and hid them. llvm-svn: 42915
-
Ted Kremenek authored
specifiers. llvm-svn: 42886
-