| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 102218
|
|
|
|
| |
llvm-svn: 102047
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:
1) Send to a object instance described by an expression (e.g., [x method:5])
2) Send to a class described by the class name (e.g., [NSString method:5])
3) Send to a superclass class (e.g, [super method:5] in class method)
4) Send to a superclass instance (e.g., [super method:5] in instance method)
Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:
1) Unchanged; the object instance is represented by an Expr*.
2) Previously stored the ObjCInterfaceDecl* referring to the class
receiving the message. Now stores a TypeSourceInfo* so that we know
how the class was spelled. This both maintains typedef information
and opens the door for more complicated C++ types (e.g., dependent
types). There was an alternative, unused representation of these
sends by naming the class via an IdentifierInfo *. In practice, we
either had an ObjCInterfaceDecl *, from which we would get the
IdentifierInfo *, or we fell into the case below...
3) Previously represented by a class message whose IdentifierInfo *
referred to "super". Sema and CodeGen would use isStr("super") to
determine if they had a send to super. Now represented as a
"class super" send, where we have both the location of the "super"
keyword and the ObjCInterfaceDecl* of the superclass we're
targetting (statically).
4) Previously represented by an instance message whose receiver is a
an ObjCSuperExpr, which Sema and CodeGen would check for via
isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
where we have both the location of the "super" keyword and the
ObjCInterfaceDecl* of the superclass we're targetting
(statically). Note that ObjCSuperExpr only has one remaining use in
the AST, which is for "super.prop" references.
The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!
This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:
if (message has a receiver expression) {
// instance message
if (isa<ObjCSuperExpr>(...)) {
// send to super
} else {
// send to an object
}
} else {
// class message
if (name->isStr("super")) {
// class send to super
} else {
// send to class
}
}
with a switch
switch (E->getReceiverKind()) {
case ObjCMessageExpr::SuperInstance: ...
case ObjCMessageExpr::Instance: ...
case ObjCMessageExpr::SuperClass: ...
case ObjCMessageExpr::Class:...
}
There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.
llvm-svn: 101972
|
|
|
|
| |
llvm-svn: 101161
|
|
|
|
|
|
|
| |
property (atomic/nonatomic) is of aggregate type with
gc'able member objects) (NeXT runtime).
llvm-svn: 101156
|
|
|
|
|
|
|
| |
atomicity of aggregate properties in setter/getter
methods. wip.
llvm-svn: 101107
|
|
|
|
| |
llvm-svn: 100946
|
|
|
|
| |
llvm-svn: 100942
|
|
|
|
| |
llvm-svn: 100462
|
|
|
|
|
|
|
|
| |
This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.
llvm-svn: 99920
|
|
|
|
| |
llvm-svn: 99884
|
|
|
|
|
|
| |
from properties of _Complex type. (radar 7351147).
llvm-svn: 99558
|
|
|
|
|
|
| |
of the class name.
llvm-svn: 97943
|
|
|
|
|
|
| |
objc method. :)
llvm-svn: 96245
|
|
|
|
|
|
|
|
|
|
| |
particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing.
- This fixes many many more places than the test case, but my feeling is we need to audit alignment systematically so I'm not inclined to try hard to test the individual fixes in this patch. If this bothers you, patches welcome!
PR6240.
llvm-svn: 95648
|
|
|
|
|
|
|
|
|
|
|
|
| |
follows (as conservatively as possible) gcc's current behavior: attributes
written on return types that don't apply there are applied to the function
instead, etc. Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks). Consistently consume CC/noreturn
information throughout codegen; enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().
llvm-svn: 95436
|
|
|
|
|
|
| |
conceptually correct. Review appreciated (Chris, Eli, Anders).
llvm-svn: 95401
|
|
|
|
|
|
| |
working code, for no apparent reason.
llvm-svn: 95244
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Don't use GlobalAliases with non-0 GEPs (GNU runtime) - this was unsupported and LLVM will be generating errors if you do it soon. This also simplifies the code generated by the GNU runtime a bit.
- Make GetSelector() return a constant (GNU runtime), not a load of a store of a constant.
- Recognise @selector() expressions as valid static initialisers (as GCC does).
- Add methods to GCObjCRuntime to emit selectors as constants (needed for using @selector() expressions as constants. These need implementing for the Mac runtimes - I couldn't figure out how to do this, they seem to require a load.
- Store an ObjCMethodDecl in an ObjCSelectorExpr so that we can get at the type information for the selector. This is needed for generating typed selectors from @selector() expressions (as GCC does). Ideally, this information should be stored in the Selector, but that would be an invasive change. We should eventually add checks for common uses of @selector() expressions. Possibly adding an attribute that can be applied to method args providing the types of a selector so, for example, you'd do something like this:
- (id)performSelector: __attribute__((selector_types(id, SEL, id)))(SEL)
withObject: (id)object;
Then, any @selector() expressions passed to the method will be check to ensure that it conforms to this signature. We do this at run time on the GNU runtime already, but it would be nice to do it at compile time on all runtimes.
- Made @selector() expressions emit type info if available and the runtime supports it.
Someone more familiar with the Mac runtime needs to implement the GetConstantSelector() function in CGObjCMac. This currently just assert()s.
llvm-svn: 95189
|
|
|
|
|
|
| |
constant Objective-C strings.
llvm-svn: 94274
|
|
|
|
| |
llvm-svn: 92138
|
|
|
|
|
|
|
| |
type have mismatched Objective-C types.
- <rdar://problem/7336352> [irgen] crash in synthesized property construction
llvm-svn: 85275
|
|
|
|
| |
llvm-svn: 82117
|
|
|
|
| |
llvm-svn: 81346
|
|
|
|
| |
llvm-svn: 80681
|
|
|
|
| |
llvm-svn: 80163
|
|
|
|
|
|
|
|
| |
"ObjCImplctSetterGetterRefExpr".
A field rename and more comments.
llvm-svn: 79537
|
|
|
|
|
|
|
|
| |
to InterfaceDecl, as it is unrelated to any property and
holds the InterfaceDecl needed for accessing class getter/setter
methods using the dot-syntax.
llvm-svn: 79371
|
|
|
|
|
|
|
|
| |
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).
llvm-svn: 79365
|
|
|
|
| |
llvm-svn: 77722
|
|
|
|
| |
llvm-svn: 77629
|
|
|
|
| |
llvm-svn: 77492
|
|
|
|
| |
llvm-svn: 77012
|
|
|
|
| |
llvm-svn: 75705
|
|
|
|
| |
llvm-svn: 75446
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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: 73702
|
|
|
|
| |
llvm-svn: 71937
|
|
|
|
|
|
| |
Patch by David Chisnall.
llvm-svn: 71023
|
|
|
|
|
|
| |
can't track down.
llvm-svn: 70155
|
|
|
|
| |
llvm-svn: 70105
|
|
|
|
| |
llvm-svn: 69650
|
|
|
|
|
|
|
|
| |
when we need them -- which is exactly what some code was already
doing!
- No intended functionality change.
llvm-svn: 69648
|
|
|
|
| |
llvm-svn: 69563
|
|
|
|
| |
llvm-svn: 69471
|
|
|
|
|
|
|
|
| |
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.
llvm-svn: 69406
|
|
|
|
|
|
|
| |
- <rdar://problem/6800351> clang not producing correct large struct
return code for Blocks
llvm-svn: 69337
|
|
|
|
|
|
| |
- No functionality change.
llvm-svn: 68987
|