aboutsummaryrefslogtreecommitdiff
path: root/Sema
AgeCommit message (Collapse)Author
2007-11-06Patch for objc2's property ASTs, as well as pretty-priting the ASTs.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43778 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06improve decl merging logic to be more correct withChris Lattner
functions. Patch contributed by Nuno Lopes, thanks! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43757 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06Add better validation for array types when merging decls. PatchChris Lattner
contributed by Oliver Hunt, thanks! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05Sema::ActOnClassMessage()...if a class method isn't found, lookup an ↵Steve Naroff
instance method. Since all classes are also instances, this is appropriate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43708 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-03Add a method prototype slot/getter to the ObjCMessageExpr AST.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43666 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-03Implement rewrite rules for ObjC string constants.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43665 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-03Fix ownership model of ParseAST to allow the dtor of Chris Lattner
ASTConsumer to process the AST before it is destroyed. This allows elimination of HandleObjcMetaDataEmission. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43659 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-02AST for @try statement.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43640 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-02AST for @finally statement.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43629 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01AST build for @catch clause (this is work in progress).Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43628 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01Remaining work to collect objective-c's type qualifiers and use them to encodeFariborz Jahanian
method types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43617 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01Propagate bitfield info.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43613 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-311) More additions for objective-c's qualifier type.Fariborz Jahanian
2) Fixed a test failure (which should have failed all along!). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43589 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Fixed problem with rewriting stand-alone @implementation (with no matching ↵Fariborz Jahanian
@interface). A new test case added. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43568 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Implement a more sensible strategy for ObjC built-in types (addressing a ↵Steve Naroff
long standing FIXME in Sema::GetObjcIdType()). This removes several gross hacks to work around the previous "lazy" behavior. Two notes: - MinimalActions still needs to be taught about the built-in types (This breaks one of the -noop test cases). I started this, then added a FIXME. - I didn't convert Sema::GetObjcProtoType() yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43567 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31After Anders check-in, we can now encode 'Class' type.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43556 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Encode Class, SEL and Objective-C objects.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43540 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Added new type and bitfield fields in some decl types in preparation for ↵Fariborz Jahanian
objective-c's type qualifiers. Added initialization of Class/SEMA types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43534 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Stop pre-defining objc_msgSend/objc_getClass in the preprocessor. Instead, I ↵Steve Naroff
generate these declaration on the fly when rewriting a message expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43529 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Tightened IgnoreParen.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43517 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30minor tweaksChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43515 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Revisited my last patch to be able to do encoding of ivar types with 'id'.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43507 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Added type encoding for 'id' type.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43504 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30- Add location info to category/protocol AST'sSteve Naroff
- Rewrite categories. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Remove a couple FIXME's for rewriting ObjC interfaces (which are now being ↵Steve Naroff
rewritten properly). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30More support for rewriting ObjC intefaces. Still some edge cases to handle...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43493 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29This commit contains lot's of small tweaks to how we pass around and store ↵Steve Naroff
SourceLocation's for interfaces/protocols/categories/implementations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43475 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29Added some comments.Ted Kremenek
Moved a dependent predicate in an if statement to be an assertion within the if statement body. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43453 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29For non-floating point types, added check for expressions of the formTed Kremenek
"x == x" and "x != x". We emit a warning for these since they always evaluate to a constant value and often indicate a logical error. Added test case for this check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43450 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29For floating point equality check, we now ignore parentheses. e.g.:Ted Kremenek
(x) == x is the treated the same as x == x. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43448 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29For checking for floating point comparison using == or !=, we now suppressTed Kremenek
errors for cases such as "x == x". Added test case to test this feature. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43447 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29when checking for type equality, ignore typedefs.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43441 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29casting to void is ok for structs (C99 6.5.4p2), this fixesChris Lattner
one bogus error on PR1750. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43436 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29Implement *skeletal* support for representing GNU inline asm stmts in the AST,Chris Lattner
resolving a crash on a .i file in PR1750. We now generate 49 errors on the .i file in that bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43433 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26Start rewriting ObjC interfaces. As a start, we comment out all the methods. ↵Steve Naroff
This involved refining how the parser/AST passes/manages SourceLocations for ObjcMethodDecl's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43404 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26This patch allows synthesis generation of ivar offset for legacy objective-c ↵Fariborz Jahanian
@implementation decl without an @interface decl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43403 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26Patch to synthesize computation of Ivar offset in rewritten c file.Fariborz Jahanian
Thanks to Steve N. to point out using of offsetof for this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43391 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19Fix a crash on test/Sema/invalid-decl.c Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43188 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18Fix the previous (short lived:-) FIXME.Steve Naroff
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18Check for Nullness of value built in GetObjcProtoType.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43155 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18Add a FIXME to an assert.Steve Naroff
Change a dyn_cast_or_null back to cast (which is more efficient). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43152 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18Patch to rewrite ivar tables metadata for classes defined.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43151 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18Tweak a recent fix to UsualArithmeticConversions (made by Chris - r43113). ↵Steve Naroff
The benefit of this tweak is it guarantees the entire routine operates on unqualified types (which I believe is a bit clearer). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43142 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18Fix a bug in Sema::CheckConditionalOperands(). When mixing pointers and null ↵Steve Naroff
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... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43114 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18UsualArithmeticConversions is crashing with an assertChris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18Fix the following bug...Steve Naroff
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... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43112 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17Implementation of AST for @protocol expression.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43075 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17Generate code for static variables that don't have initializers. Also, ↵Anders Carlsson
report an error if a static initializer is not constant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16Fix location processing of @selector: the range should include the @ sign.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16Add Sema::CheckMessageArgumentTypes()...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43050 91177308-0d34-0410-b5e6-96231b3b80d8