Граф коммитов

1235 Коммитов

Автор SHA1 Сообщение Дата
Steve Naroff c0006097e9 Incorporate some feedback from Chris...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43285 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 01:09:48 +00:00
Devang Patel c4c429a1a5 Constify methods and reuse RecordOrganizer object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43284 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:56:23 +00:00
Devang Patel 0e63f6b436 check base type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43283 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:54:17 +00:00
Devang Patel 71bcb09b8f Add notes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43282 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:32:16 +00:00
Devang Patel 977f14e1ab Use isUnionType() predicate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43281 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:28:49 +00:00
Devang Patel 655bf3df1f untabify
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43280 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:26:24 +00:00
Hartmut Kaiser 21fdf41672 Fixed a strange construct, please review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43278 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:07:36 +00:00
Hartmut Kaiser 79016528d2 Silenced a VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43277 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 00:06:59 +00:00
Steve Naroff ebf2b56bce Add some plumbing to rewrite message expressions (still under construction).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43274 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:50:29 +00:00
Devang Patel dbb46b1985 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43269 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:29:51 +00:00
Devang Patel b1e3989731 Handle nested structs.
typdef struct A { int i; struct A *next; } A


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43268 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:26:46 +00:00
Ted Kremenek c637e6b7af Implemented serialization for IdentifierInfo and IdentifierTable.
Updated serialization test code in the driver to test serialization of
these types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 22:18:37 +00:00
Devang Patel b9b00ad626 Handle simple struct member expr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43258 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 20:28:39 +00:00
Steve Naroff 7e15891fc8 - Add rewrite rule for @class.
- Add setter/getter to ObjcClassDecl.
- Predefined key runtime functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43257 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 20:20:08 +00:00
Fariborz Jahanian deef51838b Patch to complete metadata generation for each implemented class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 18:53:48 +00:00
Devang Patel b84a06e68f Begin struct layout work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43236 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 02:10:49 +00:00
Fariborz Jahanian 9f0a1cb8cf Patch for initialization of class's Meta-class metadata.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 00:02:02 +00:00
Fariborz Jahanian e887c09395 This patch generates protocol metadata and all its sub-metadata.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 21:41:37 +00:00
Chris Lattner 9a11b9abb9 Fix a crash on test/Sema/invalid-decl.c
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43188 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 20:10:30 +00:00
Hartmut Kaiser e203877d23 Silenced a VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43179 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 15:50:35 +00:00
Gabor Greif 58065b2d80 add NL at end of file
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43178 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 15:38:32 +00:00
Fariborz Jahanian 776d6ff623 rewrite of metadata for implemented instance methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43159 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 00:36:46 +00:00
Steve Naroff 54d02e9a91 Include a simple test case for the previous commit...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 00:05:15 +00:00
Steve Naroff 806a4ebcf5 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 23:53:51 +00:00
Ted Kremenek 9ac5928abe Fixed DeclStmt::child_begin() to actually create an iterator that
visits its decls, rather than just creating an "end()" iterator.

Fixed child_end() for statements and expressions to use
child_iterator() to create the end() iterator, rather than just
returning NULL.

Fixed bug in StmtIterator where we did not correctly detect if we had
marched off the end of the ScopedDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 23:28:49 +00:00
Fariborz Jahanian 3e27aa16e6 Check for Nullness of value built in GetObjcProtoType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43155 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 22:59:23 +00:00
Ted Kremenek 18e17e773a Minor grammar fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43154 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 22:50:52 +00:00
Steve Naroff 733002fac5 Add a FIXME to an assert.
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-18 22:17:45 +00:00
Fariborz Jahanian f4d331dd92 Patch to rewrite ivar tables metadata for classes defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43151 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 22:09:03 +00:00
Chris Lattner c266acd6d7 remove dead #include
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43149 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 21:23:00 +00:00
Fariborz Jahanian 545b9ae381 First patch toward rewriting of objective-c's meta data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43143 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 19:23:00 +00:00
Steve Naroff 3187e20472 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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43142 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 18:55:53 +00:00
Ted Kremenek 6acaabc91e Added StmtIterator.cpp and StmtIterator.h to the XCode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43139 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 18:22:01 +00:00
Ted Kremenek c325e7f51b Refactored StmtIterator into classes StmtIteratorBase (non-templated)
and StmtIteratorImpl (templated), which StmtIterator and
ConstStmtIterator now succintly subclass.

Implemented iteration over the initializers in DeclStmts.  This is not
thoroughly tested, so there may be bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43138 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 18:19:31 +00:00
Ted Kremenek 401aa7b146 Replaced virtual method call to child_begin() in child_end() by
directly inlining its logic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43137 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 18:17:43 +00:00
Ted Kremenek c7c326ad0c Fixed broken build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43132 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:25:40 +00:00
Hartmut Kaiser 95c062b94e Silenced a couple of VC++ warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43125 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 12:47:01 +00:00
Hartmut Kaiser 19f092a3b9 Updated VC++ build system
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43124 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 12:32:10 +00:00
Steve Naroff d4dd30ff21 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...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43114 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 05:13:08 +00:00
Chris Lattner 27b837c3b8 UsualArithmeticConversions is crashing with an assert
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-18 03:50:33 +00:00
Steve Naroff fd8b4a4b29 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...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43112 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 03:27:23 +00:00
Chris Lattner 994f939926 remove extraneous space in @selector()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43110 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 00:39:29 +00:00
Chris Lattner 02209fbebc remove typedef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43109 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 00:38:23 +00:00
Ted Kremenek 9caf8b1ca6 Implemented 90% functionality of new child_iterator for Stmt objects
that will (soon) allow iteration over the initializers in
declarations.  This new iterator mechanism is implemented by the
classes StmtIterator and ConstStmtIterator.

Patched a few files to use "operator++" instead of "operator+" on
child_iterators.

Friendship added in VarDecl to StmtIterator to allow returning a
reference to the initializer within the VarDecl.  We may not wish this
as a permanent solution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43105 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 00:24:38 +00:00
Chris Lattner 2777e494c9 Make control flow in Expr::isConstantExpr more simple and
local, making the code easier to read.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43104 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 00:20:32 +00:00
Chris Lattner 01c5748c29 Add new API to rewrite one stmt/expr with another.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43101 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:35:30 +00:00
Chris Lattner 5075477aad Add rewriter support for @encode expressions. For example,
we currently turn:

    c = @encode(char *)[2] + 4;

into:

    c = "foo"[2] + 4;

Right now the foo string is hard coded, but you can imagine a world
where it wouldn't be :)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43093 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:28:00 +00:00
Chris Lattner 9d62a5b31e The size returned by Rewriter::getRangeSize should include
the size of the last token.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43092 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:23:07 +00:00
Chris Lattner fd1f344f87 Fix assertion for raw lexer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43091 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:22:38 +00:00
Chris Lattner 9a61194376 Move token length calculation out of the diagnostics machinery into
the lexer, where it can be shared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43090 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:18:47 +00:00