| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 128157
|
|
|
|
|
|
| |
selectors (GNU runtimes).
llvm-svn: 128156
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that I hadn't used C++ for several years before writing most of this code).
Still lots more to do. This set of changes includes:
- Remove the distinction between typed and untyped selectors. More accurately
reflect what the runtime does, by using typed selectors everywhere, with an
empty type field if the types are unknown. Now we just store a small list of
types for each selector (in theory, this should always be exactly one, but
this constraint was not enforced back in 1986 when it should have been).
- Add some consistency to how runtime functions are created. These are all
generated via the LazyRuntimeFunction class (which might be useful outside
CGObjCGNU - feel free to move it into a header if it is). This function
stores the types of a function, looks it up the first time it's used, and
caches the result. This means that we're now not wasting time constructing
the llvm::FunctionType every time some of the functions are looked up, but
also not inserting references to runtime functions into the module if they're
not actually used.
- Started separating out the fragile and non-fragile ABI behaviours into two
subclasses of CGObjCGNU: CGObjCGCC for the legacy GCC runtime ABI and
CGObjCGNUstep for the new GNUstep ABI. Not all of the differences in
behaviour are factored out yet, but they will be in future commits.
- Removed all of the CodeGen:: things: we've been using namespace CodeGen in
this file for ages, so having explicit namespace specifiers is just a bit
confusing.
- Added a few more comments.
- Used llvm::StringRef instead of std::string in a few places.
- Finally got around to storing the module path in the module structure. The
ABI says that the compiler should do this, although it's not used in the
runtime or exposed outside the runtime, so it's pretty useless.
Still to do:
- We currently have two code paths for generating try blocks, one for ObjC and
one for ObjC++. Not only are these substantially similar, they are also very
similar to the CGObjCMac version. These need factoring out into a single
parameterised implementation, either in CGObjCRuntime or CodeGenFunction.
The EmitObjCXXTryStmt() function was added so that the changes to fix a bug
in time for the 2.9 release would be self-contained and reduce the chances of
breaking anything else, but these should be done properly as soon as
possible.
- Split up some large functions (e.g. GenerateClass()) into smaller functions
for generating the various data structures.
- The method lookup code into the two subclasses, removing the conditionals in
the message send functions.
- Add doxygen comments on the remaining undocumented functions.
- We seem to be generating global pointer variables for selectors, then storing
a pointer to the selector, then generating a load of this pointer (and then a
load of the real selector later) every time a static selector is used. I can
only assume I was asleep or drunk when I did this - we should just be
referencing the selectors directly in the selector array.
llvm-svn: 128152
|
|
|
|
|
|
| |
expects this. Actually, it expects a long, but that's a bug that will be fixed in the next commit...
llvm-svn: 128102
|
|
|
|
| |
llvm-svn: 127980
|
|
|
|
| |
llvm-svn: 127736
|
|
|
|
| |
llvm-svn: 127580
|
|
|
|
|
|
| |
the one CGObjC was calling. Fixes bug r9294.
llvm-svn: 126312
|
|
|
|
|
|
| |
not, in fact, 0, even for very small classes. (GNU runtime)
llvm-svn: 126161
|
|
|
|
|
|
| |
functionality intended.
llvm-svn: 125156
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- BlockDeclRefExprs always store VarDecls
- BDREs no longer store copy expressions
- BlockDecls now store a list of captured variables, information about
how they're captured, and a copy expression if necessary
With that in hand, change IR generation to use the captures data in
blocks instead of walking the block independently.
Additionally, optimize block layout by emitting fields in descending
alignment order, with a heuristic for filling in words when alignment
of the end of the block header is insufficient for the most aligned
field.
llvm-svn: 125005
|
|
|
|
|
|
| |
Pure motion.
llvm-svn: 124484
|
|
|
|
|
|
| |
refactoring of Mac runtime (returns the same function for both, as the Mac runtimes currently only provide a single entry point for setting and getting struct properties, although this will presumably be fixed at some point).
llvm-svn: 122569
|
|
|
|
| |
llvm-svn: 118498
|
|
|
|
| |
llvm-svn: 118172
|
|
|
|
|
|
| |
ambiguous context.
llvm-svn: 116567
|
|
|
|
|
|
|
|
| |
information when imported variable is used
more than once. Originally though to be a bug in importing
block varibles. Fixes radar 8417746.
llvm-svn: 113675
|
|
|
|
|
|
| |
and remove getStrData(). Patch by Peter Davies (with some tweaks).
llvm-svn: 111229
|
|
|
|
|
|
| |
for objective-c/c++ blocks (NeXt runtime).
llvm-svn: 110213
|
|
|
|
|
|
| |
Diagnose attempts to do this under the GNU or fragile NeXT runtimes.
llvm-svn: 109298
|
|
|
|
|
|
|
| |
as well as some significant asymptotic inefficiencies with threading
multiple jumps through deep cleanups.
llvm-svn: 109274
|
|
|
|
|
|
| |
(GNU runtime).
llvm-svn: 109012
|
|
|
|
|
|
| |
optimised away (GNU runtime).
llvm-svn: 109010
|
|
|
|
|
|
| |
commits.
llvm-svn: 109000
|
|
|
|
|
|
|
| |
a big deal, except that I want to eliminate the shared-code EH cleanups
in preparation for a significant algorithmic fix.
llvm-svn: 108973
|
|
|
|
|
|
| |
Implements radar 8203301.
llvm-svn: 108917
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mostly in avoiding unnecessary work at compile time but also in producing more
sensible block orderings.
Move the destructor cleanups for local variables over to use lazy cleanups.
Eventually all cleanups will do this; for now we have some awkward code
duplication.
Tell IR generation just to never produce landing pads in -fno-exceptions.
This is a much more comprehensive solution to a problem which previously was
half-solved by checks in most cleanup-generation spots.
llvm-svn: 108270
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
self-host. Hopefully these results hold up on different platforms.
I tried to keep the GNU ObjC runtime happy, but it's hard for me to test.
Reimplement how clang generates IR for exceptions. Instead of creating new
invoke destinations which sequentially chain to the previous destination,
push a more semantic representation of *why* we need the cleanup/catch/filter
behavior, then collect that information into a single landing pad upon request.
Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional
control flow) are generated, since it's actually fairly closely tied in with
the former. Remove the need to track which cleanup scope a block is associated
with.
Document a lot of previously poorly-understood (by me, at least) behavior.
The new framework implements the Horrible Hack (tm), which requires every
landing pad to have a catch-all so that inlining will work. Clang no longer
requires the Horrible Hack just to make exceptions flow correctly within
a function, however. The HH is an unfortunate requirement of LLVM's EH IR.
llvm-svn: 107631
|
|
|
|
|
|
| |
an lvalue. Fixes PR7390.
llvm-svn: 106235
|
|
|
|
|
|
|
|
|
|
|
|
| |
provides C "integer type" semantics in C and C++ "integral type"
semantics in C++.
Note that I still need to update isIntegerType (and possibly other
predicates) using the same approach I've taken for
isIntegralType(). The two should have the same meaning, but currently
don't (!).
llvm-svn: 106074
|
|
|
|
|
|
|
|
| |
objective-c++ class objects which have GC'able objc object
pointers and need to use ObjC's objc_memmove_collectable
API (radar 8070772).
llvm-svn: 106061
|
|
|
|
|
|
|
| |
critical for ObjC++ correctness; hard to test independently of various
required Sema changes, though.
llvm-svn: 104422
|
|
|
|
|
|
| |
returning non-pointer-sized things were generating invalid IR inside @try blocks.
llvm-svn: 104222
|
|
|
|
|
|
| |
out. The remaining ones are okay.
llvm-svn: 103973
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ObjCObjectType, which is basically just a pair of
one of {primitive-id, primitive-Class, user-defined @class}
with
a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared). ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.
Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet. Remove some number of methods that are no
longer used, at least after this patch.
By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.
llvm-svn: 103870
|
|
|
|
| |
llvm-svn: 103368
|
|
|
|
| |
llvm-svn: 103355
|
|
|
|
|
|
| |
in the generated bitcode.
llvm-svn: 103353
|
|
|
|
|
|
| |
metadata in the caller.
llvm-svn: 102862
|
|
|
|
| |
llvm-svn: 102839
|
|
|
|
| |
llvm-svn: 102837
|
|
|
|
|
|
|
|
| |
to the call site.
Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining.
llvm-svn: 102833
|
|
|
|
| |
llvm-svn: 102711
|
|
|
|
|
|
|
|
| |
ObjCInterfaceDecl for class messages and removed the boolean IsClassMessage argument, which wasn't used anywhere.
Emitted some metadata on message sends to allow a later pass to do some speculative inlining of class methods (GNU runtime). Speculative inlining of instance methods requires type feedback to be useful (work in progress), but for class methods it works quite nicely.
llvm-svn: 102514
|
|
|
|
| |
llvm-svn: 102499
|
|
|
|
| |
llvm-svn: 102497
|
|
|
|
| |
llvm-svn: 102459
|
|
|
|
|
|
|
|
|
| |
This works around stack corruption / crashes resulting from PR6944, and also
works around people who expect 'what works on my machine' to work everywhere
(GCC crashes in a number of cases on SPARC that should now work correctly with
clang).
llvm-svn: 102430
|
|
|
|
|
|
|
| |
@catch a VarDecl. The dynamic type is still a ParmVarDecl, but that
will change soon. No effective functionality change.
llvm-svn: 102341
|
|
|
|
|
|
|
|
|
|
| |
statements. Instead of the @try having a single @catch, where all of
the @catch's were chained (using an O(n^2) algorithm nonetheless),
@try just holds an array of its @catch blocks. The resulting AST is
slightly more compact (not important) and better represents the actual
language semantics (good).
llvm-svn: 102221
|