| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Patch by Ryan Flynn
llvm-svn: 75879
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Objective-C pointers to using ObjCObjectPointerType.
Now the checking for 'attribute ((nonnull))' in Sema doesn't emit an error when
trying to apply that attribute to a parameter that is an Objective-C pointer
(this is a regression).
To prevent this regression from occuring in the future, the 'nonnull.c' test was
moved to test/SemaObjC and renamed 'nonnull.m'. I also enhanced the tests to
show that function calls involved a NULL Objective-C pointer constant does not
trigger a warning. This is consistent with GCC, but should likely be fixed.
llvm-svn: 75856
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
subclasses.
Timings showed no significant difference before and after the commit.
llvm-svn: 74504
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
llvm-svn: 74280
|
| |
|
|
| |
llvm-svn: 73702
|
| |
|
|
|
|
| |
thereof. Patch by Anders Johnsen!
llvm-svn: 73641
|
| |
|
|
| |
llvm-svn: 73101
|
| |
|
|
|
|
| |
Still more to do.
llvm-svn: 72173
|
| |
|
|
| |
llvm-svn: 72111
|
| |
|
|
| |
llvm-svn: 72020
|
| |
|
|
| |
llvm-svn: 71936
|
| |
|
|
| |
llvm-svn: 71909
|
| |
|
|
|
|
| |
Work in progress...
llvm-svn: 71908
|
| |
|
|
|
|
| |
No change in functionality.
llvm-svn: 71894
|
| |
|
|
|
|
| |
blocks and function pointers.
llvm-svn: 71888
|
| |
|
|
| |
llvm-svn: 71790
|
| |
|
|
| |
llvm-svn: 71788
|
| |
|
|
|
|
| |
dispatch arguments which have sentinel attribute.
llvm-svn: 71737
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
cf_returns_retained. Currently this attribute can now be applied to any
Objective-C method or C function that returns a pointer or Objective-C object
type.
Modify the tablegen definition of diagnostic 'warn_attribute_wrong_decl_type' to
expect that the diagnostics infrastructure will add quotes around the attribute
name when appropriate. Alonq with this change, I modified the places where this
warning is issued to passed the attribute's IdentifierInfo* instead of having a
hard-coded C constant string.
llvm-svn: 71718
|
| |
|
|
|
|
|
|
| |
It seems dubious to me that isIntegerType() returns true for
vectors of integers, but not complex integers. This should
probably be rethought, I'll file a bugzilla.
llvm-svn: 71640
|
| |
|
|
|
|
|
|
|
| |
don't support. While it would be nice to support this eventually,
this form is not common at all (just seen in gcc testsuite) and
it might be better to model vector_size as a type attribute anyway.
For now just emit a nice error on it.
llvm-svn: 71633
|
| |
|
|
|
|
|
| |
ns_returns_retained, but do not include the other ownership attributes
we previously had.
llvm-svn: 71308
|
| |
|
|
| |
llvm-svn: 71216
|
| |
|
|
|
|
|
| |
- Rename 'ns_returns_owned' -> 'ns_returns_retained'.
- Rename 'cf_returns_owned' -> 'cf_returns_retained'.
llvm-svn: 71182
|
| |
|
|
| |
llvm-svn: 70990
|
| |
|
|
| |
llvm-svn: 70952
|
| |
|
|
|
|
|
|
|
|
| |
ns_ownership_returns -> ns_returns_owned
ns_ownership_retain -> ns_retains
ns_ownership_release -> ns_releases
cf_ownership_retain -> cf_retains
cf_ownership_release -> cf_releases
llvm-svn: 70949
|
| |
|
|
| |
llvm-svn: 70941
|
| |
|
|
| |
llvm-svn: 70940
|
| |
|
|
| |
llvm-svn: 70901
|
| |
|
|
| |
llvm-svn: 70897
|
| |
|
|
|
|
|
|
|
|
|
| |
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'
Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.
llvm-svn: 70884
|
| |
|
|
|
|
|
|
| |
return type and the selector. This is inconsistent with C functions
(where such attributes would be placed on the return type, not the the
FunctionDecl), and is inconsistent with what people are use to seeing.
llvm-svn: 70878
|
| |
|
|
|
|
|
| |
applied to ObjCMethodDecls, not just parameters. This allows one to specific
side-effects on the receiver of a message expression. No checker support yet.
llvm-svn: 70505
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
appear between the return type and the selector. This is a separate code path
from regular attribute processing, as we only want to (a) accept only a specific
set of attributes in this place and (b) want to distinguish to clients the
context in which an attribute was added to an ObjCMethodDecl.
Currently, the attribute 'objc_ownership_returns' is the only attribute that
uses this new feature. Shortly I will add a warning for 'objc_ownership_returns'
to be placed at the end of a method declaration.
llvm-svn: 70504
|
| |
|
|
|
|
|
| |
based on a patch from Anders Johnsen. CodeGen support is incomplete,
in that we do not properly coerce to the first field's type.
llvm-svn: 70419
|
| |
|
|
| |
llvm-svn: 70403
|
| |
|
|
|
|
| |
to add 'CFMakeCollectable' semantics to a method.
llvm-svn: 70336
|
| |
|
|
|
|
|
|
|
|
|
| |
mode and in the presence of __gnu_inline__ attributes. This should fix
both PR3989 and PR4069.
As part of this, we now keep track of all of the attributes attached
to each declaration even after we've performed declaration
merging. This fixes PR3264.
llvm-svn: 70292
|
| |
|
|
|
|
|
| |
'objc_ownership_cfrelease'. These are the 'release' equivalents of
'objc_ownership_retain' and 'objc_ownership_cfretain' respectively.
llvm-svn: 70235
|
| |
|
|
|
|
| |
HandleObjCOwnershipParmAttr. No functionality change (hopefully).
llvm-svn: 70224
|
| |
|
|
|
|
|
|
| |
as 'objc_ownership_cfretain' except that the method acts like a CFRetain instead
of a [... retain] (important in GC modes). Checker support is wired up, but
currently only for Objective-C message expressions (not function calls).
llvm-svn: 70218
|
| |
|
|
|
|
|
| |
cleanup attribute checking. The difference isn't normally visible, but it
can make a difference...
llvm-svn: 70104
|
| |
|
|
|
|
| |
support -pg, we never instrument :)
llvm-svn: 70061
|
| |
|
|
|
|
|
|
| |
to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function increments the reference count of a passed
object.
llvm-svn: 70005
|
| |
|
|
|
|
|
| |
up to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function returns an owned an Objective-C object.
llvm-svn: 70001
|