Commit Graph

365 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 60ed560428 Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.
DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

llvm-svn: 79392
2009-08-19 01:27:57 +00:00
Owen Anderson c36edfede5 Update for LLVM API change.
llvm-svn: 78957
2009-08-13 23:27:53 +00:00
Owen Anderson 41a750271b Update for LLVM API change.
llvm-svn: 78946
2009-08-13 21:57:51 +00:00
Owen Anderson 758428f4e3 Update for LLVM API change.
llvm-svn: 78259
2009-08-05 23:18:46 +00:00
Daniel Dunbar a1d8bcd33e When generating cleanup blocks for Obj-C @finally, mark them as catch all blocks
from the perspective of LLVM exception handling. Otherwise the C++ personality
function may decide not to run them, if it only detects cleanup handlers.
 - Test case for this is exceptions.m in llvm-test.

llvm-svn: 77999
2009-08-03 21:20:07 +00:00
Daniel Dunbar 59e476b1b9 Formatting fixes (trailing whitespace, 80-cols, indentation).
llvm-svn: 77972
2009-08-03 17:06:42 +00:00
Owen Anderson 0b75f23b94 Update for LLVM API change.
llvm-svn: 77722
2009-07-31 20:28:54 +00:00
Owen Anderson fe4e34707c Update for LLVM API change.
llvm-svn: 77686
2009-07-31 17:39:36 +00:00
Mike Stump 658fe02d17 Canonicalize else spacing.
llvm-svn: 77629
2009-07-30 22:28:39 +00:00
Douglas Gregor 716dabbb1b Eliminate an unused-variable warning
llvm-svn: 77518
2009-07-29 22:40:58 +00:00
Owen Anderson 9793f0e4d7 Update for LLVM API change.
llvm-svn: 77514
2009-07-29 22:16:19 +00:00
Ted Kremenek c23c7e6a51 Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsRecordType() -> Type::getAs<RecordType>()
  Type::getAsPointerType() -> Type::getAs<PointerType>()
  Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
  Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
  Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
  Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
  Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsTagType() -> Type::getAs<TagType>()
  
And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.

llvm-svn: 77510
2009-07-29 21:53:49 +00:00
Owen Anderson ade90fd1ba Update for LLVM API change.
llvm-svn: 77492
2009-07-29 18:54:39 +00:00
Owen Anderson 47034e1733 Update for LLVM API change.
llvm-svn: 77349
2009-07-28 18:33:04 +00:00
Chris Lattner 1d0f16f22a add some fixme's
llvm-svn: 77343
2009-07-28 18:25:06 +00:00
Fariborz Jahanian e309b48a22 Patch for objc's zero-const exception to not assume
that @catch(...) cathces all exceptions (c++ objects
are not cought by that).

llvm-svn: 77270
2009-07-27 23:12:41 +00:00
Owen Anderson 0e0189d64d Update for LLVM API change.
llvm-svn: 77267
2009-07-27 22:29:56 +00:00
Owen Anderson b7a2fe6f81 Update for LLVM API change.
llvm-svn: 77012
2009-07-24 23:12:58 +00:00
Anders Carlsson e2c6baf629 Don't use getLLVMFieldNo for bitfields when constructing the ivar layout maps for GC.
llvm-svn: 76978
2009-07-24 17:23:54 +00:00
Daniel Dunbar c46a079957 Fix declaration of obc_enumerationMutation function, for GNU runtime.
llvm-svn: 76959
2009-07-24 07:40:24 +00:00
Owen Anderson a265a3876c Update for LLVM API change.
llvm-svn: 76599
2009-07-21 18:06:41 +00:00
Anders Carlsson 27b50135ee Rename NextOffset to DataSize, which better matches the Itanium C++ ABI
llvm-svn: 76339
2009-07-18 21:26:44 +00:00
Anders Carlsson 15b73deeea Revert r75641.
llvm-svn: 76327
2009-07-18 19:43:29 +00:00
Chris Lattner f56501ce48 fix objc codegen to not have its own list of things that eventually get into llvm.used, just
populate CGM's list directly.

llvm-svn: 76266
2009-07-17 23:57:13 +00:00
Ted Kremenek 8a286fbdb9 Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.

llvm-svn: 76193
2009-07-17 17:50:17 +00:00
Ted Kremenek b825c0ddc5 Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.
llvm-svn: 76139
2009-07-17 01:20:38 +00:00
Ted Kremenek e3fb4b6524 Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.

llvm-svn: 76098
2009-07-16 19:58:26 +00:00
Steve Naroff 79d1215d83 Remove ASTContext::isObjCObjectPointerType().
Convert all clients to use the new predicate on Type.

llvm-svn: 76076
2009-07-16 15:41:00 +00:00
Owen Anderson 170229f68d Update for LLVM API change, and contextify a bunch of related stuff.
llvm-svn: 75705
2009-07-14 23:10:40 +00:00
Anders Carlsson 466fd0a16d Rename RecordLayout.h to ASTRecordLayout.h
llvm-svn: 75641
2009-07-14 17:29:11 +00:00
Owen Anderson ae86c19e68 Update for LLVM API change.
llvm-svn: 75446
2009-07-13 04:10:07 +00:00
Daniel Dunbar 9d82da40ec Generate correct prototype for objc_enumerationMutation.
- This was a latent bug exposed by the recent objc type changes.

llvm-svn: 75383
2009-07-11 20:32:50 +00:00
Eli Friedman 55179ca5aa Fix typo (found by gcc warning).
llvm-svn: 75325
2009-07-11 00:57:02 +00:00
Steve Naroff 7cae42b07a This patch includes a conceptually simple, but very intrusive/pervasive change.
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. 

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.

llvm-svn: 75314
2009-07-10 23:34:53 +00:00
Owen Anderson c10c8d3e2b Update for LLVM API change.
llvm-svn: 75028
2009-07-08 19:05:04 +00:00
Owen Anderson 9f211fb4fa Update for LLVM API change.
llvm-svn: 74986
2009-07-08 01:29:18 +00:00
Fariborz Jahanian 5f21d2f69a Implemented memmove_collectable API for Next runtime
when struct variables with GC'able members are copied into.
Will provide a test case later.

llvm-svn: 74984
2009-07-08 01:18:33 +00:00
Chris Lattner 3dd1b4b6f2 use new and simplified LLVM APIs. Patch by Jay Foad!
llvm-svn: 74585
2009-07-01 04:13:52 +00:00
Argyrios Kyrtzidis cfbfe78e9e De-ASTContext-ify DeclContext.
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

llvm-svn: 74506
2009-06-30 02:36:12 +00:00
Argyrios Kyrtzidis b4b64ca752 Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

llvm-svn: 74501
2009-06-30 02:34:44 +00:00
Daniel Dunbar c7d0e6525d Simplify, and fix a possible crash (never happens however, because we don't ever
take this path with non-builtin floating point types).

llvm-svn: 74303
2009-06-26 18:32:06 +00:00
Fariborz Jahanian 248c719a68 Patch fixes an obscure bug when 'used' attribute is applied to
variables in ObjC's Next runtime mode. Next runtime also implicitly applies
'used' attribute on some of its meta-data. This results in two 
'llvm.used' arrays to be generated, and one of them is renamed to
'llvm.used1'.

llvm-svn: 74008
2009-06-23 21:47:46 +00:00
Douglas Gregor 78bd61f661 Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.
llvm-svn: 73702
2009-06-18 16:11:24 +00:00
Daniel Dunbar 76d864c7e7 Support complex properties, ivars and message expressions.
llvm-svn: 73158
2009-06-10 04:38:50 +00:00
Fariborz Jahanian 7c80959a97 Cleanup/Refactoring of ivar collection. No change in functionality.
llvm-svn: 72827
2009-06-04 01:19:09 +00:00
Fariborz Jahanian a6bed8370e Minor refactoring. Uses an existing API to lookup a class method.
llvm-svn: 72203
2009-05-21 01:03:45 +00:00
Mike Stump 18bb9284ff Reflow some comments.
llvm-svn: 71937
2009-05-16 07:57:57 +00:00
Daniel Dunbar 9a017d7fcf Classes with "+load" methods need to go in the non-lazy class list (or
else the method will not be found by the runtime at class load time).

llvm-svn: 71904
2009-05-15 22:33:15 +00:00
Daniel Dunbar 19573e7d29 Factor code for adding module-level class lists into separate method.
- No functionality change.

llvm-svn: 71898
2009-05-15 21:48:48 +00:00
Fariborz Jahanian 1880136520 Removed 4-letter :) word in comment.
Used simple array for Selector build.

llvm-svn: 71674
2009-05-13 16:19:02 +00:00