summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCRuntime.h
Commit message (Collapse)AuthorAgeFilesLines
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-131-2/+2
| | | | | | Modifications made by clang-tidy with minor tweaks. llvm-svn: 215557
* [C++11] Use 'nullptr'. CodeGen edition.Craig Topper2014-05-211-3/+3
| | | | llvm-svn: 209272
* Refactor linkage computation in CGObjCMac.cpp.Rafael Espindola2014-02-261-1/+2
| | | | | | | | | | | | | | Before this patch the globals were created with the wrong linkage and patched afterwards. From the comments it looks like something would complain about having an internal GV with no initializer. At least in clang the verifier will only run way after we set the initializer, so that is not a problem. This patch should be a nop. It just figures out the linkage earlier and converts the old calls to setLinkage to asserts. The only case where that is not possible is when we first see a weak import that is then implemented. In that case we have to change the linkage, but that is the only setLinkage left. llvm-svn: 202305
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | calls and declarations. LLVM has a default CC determined by the target triple. This is not always the actual default CC for the ABI we've been asked to target, and so we sometimes find ourselves annotating all user functions with an explicit calling convention. Since these calling conventions usually agree for the simple set of argument types passed to most runtime functions, using the LLVM-default CC in principle has no effect. However, the LLVM optimizer goes into histrionics if it sees this kind of formal CC mismatch, since it has no concept of CC compatibility. Therefore, if this module happens to define the "runtime" function, or got LTO'ed with such a definition, we can miscompile; so it's quite important to get this right. Defining runtime functions locally is quite common in embedded applications. llvm-svn: 176286
* objectiveC++: When throwing c++ exception of Fariborz Jahanian2013-01-101-1/+2
| | | | | | | an objectiveC object, use objc_exception_throw to raise the exception. // rdar://12605907 llvm-svn: 172091
* Reapply r170344, this time without forgetting to commit the header changes.David Chisnall2012-12-171-3/+6
| | | | llvm-svn: 170354
* Revert "Added support for new property helpers (GNUstep runtime)."Benjamin Kramer2012-12-171-6/+3
| | | | | | This reverts commit r170344. Doesn't even compile. llvm-svn: 170351
* Added support for new property helpers (GNUstep runtime).David Chisnall2012-12-171-3/+6
| | | | llvm-svn: 170344
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+2
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* objective-C blocks: Provide layout map for byrefFariborz Jahanian2012-11-141-0/+2
| | | | | | variables captured in a block. // rdar://12184410 llvm-svn: 167931
* Put something sane in the DWARF offset field for bitfield ObjC ivars.Eli Friedman2012-11-061-0/+6
| | | | | | | | | This is useful because unnamed bitfields can have effects on the offsets which are not otherwise reflected in the DWARF information. <rdar://problem/12629719> llvm-svn: 167503
* Back out 167431+167437+167487; I didn't realize how incomplete our testEli Friedman2012-11-061-6/+6
| | | | | | coverage of this code is. llvm-svn: 167495
* Propagate CharUnits into ObjC CodeGen. No intended functional change.Eli Friedman2012-11-061-6/+6
| | | | llvm-svn: 167431
* objective-C arc/mrr: Patch for the new block variable layout meta-data.Fariborz Jahanian2012-10-271-0/+2
| | | | | | It is currently off (so no tests). This is wip. llvm-svn: 166892
* Documentation cleanup:James Dennett2012-06-151-9/+9
| | | | | | | | * Escaped Objective-C @keywords in Doxygen comments; * Documented more accurate \params; * Exposed some more summaries using \brief. llvm-svn: 158559
* Documentation cleanup, fixing Doxygen markup. Mostly this avoids common termsJames Dennett2012-06-111-1/+1
| | | | | | | | | | | | | | such as "protocol" and "expression" being implicitly turned into links to mistakenly-generated Doxygen pages: - Escaping @ symbols when Doxygen would otherwise incorrectly interpret them; - Escaping # symbols when they're not intended as explicit Doxygen link requests, such as when discussing preprocessor directives; - In one odd case, unescaping @ in @__experimental_modules_import, because Doxygen wrote '\@' to the output in that case, causing the example in the description of ImportDecl to be wrong; and - Fixing a typo: @breif -> @brief. llvm-svn: 158299
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-1/+5
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* Whether an argument is required (in contrast with being anJohn McCall2012-02-171-0/+16
| | | | | | | | | | | | | | | | | | | | | optional argument passed through the variadic ellipsis) potentially affects how we need to lower it. Propagate this information down to the various getFunctionInfo(...) overloads on CodeGenTypes. Furthermore, rename those overloads to clarify their distinct purposes, and make sure we're calling the right one in the right place. This has a nice side-effect of making it easier to construct a function type, since the 'variadic' bit is no longer separable. This shouldn't really change anything for our existing platforms, with one minor exception --- we should now call variadic ObjC methods with the ... in the "right place" (see the test case), which I guess matters for anyone running GNUStep on MIPS. Mostly it's just a substantial clean-up. llvm-svn: 150788
* Support @compatibility_alias at run time (GNUstep Runtime)David Chisnall2012-01-311-0/+3
| | | | | | Patch by Niels Grewe! llvm-svn: 149401
* objc++: some declarations related to atomicFariborz Jahanian2012-01-061-0/+3
| | | | | | | properties of c++ object types with non-trivial assignment copy. Not used yet. // rdar://6137845 llvm-svn: 147666
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-2/+1
| | | | llvm-svn: 140367
* Support for catching objc pointer objects in c++ catch-statementFariborz Jahanian2011-06-231-2/+1
| | | | | | in fragile abi mode and some other cleanups. // rdar://8940528 llvm-svn: 133747
* Alloa catching Objective-C id's being thrown with C++ throwFariborz Jahanian2011-06-221-1/+2
| | | | | | in Darwin's fragile abi mode. // rdar://8940528 llvm-svn: 133639
* Automatic Reference Counting.John McCall2011-06-151-1/+7
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Fix some problems where functions must be bitcast but we're expecting a ↵David Chisnall2011-05-231-3/+3
| | | | | | | | llvm::Function of the right type. PR9994. llvm-svn: 131930
* Patch to fix IR-gen crash generating structure ABI which implementsFariborz Jahanian2011-05-171-0/+1
| | | | | | | user specified string class via -fconstant-string-class option. pr9914. llvm-svn: 131496
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | llvm-svn: 130068
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Continuing work on ObjC tidyup:David Chisnall2011-03-251-0/+20
| | | | | | | | | | | | | | | | - Moved the CGObjCRuntime functions out of CGObjCMac.cpp into CGObjCRuntime.cpp - Added generic functions in CGObjCRuntime for emitting @try and @synchronize blocks, usable by any runtime that uses DWARF exceptions. - Made the GNU runtimes use these functions. It should now be possible to replace the equivalent functions in CGObjCNonFragileABIMac with simple calls to these two functions, providing the runtime functions as arguments. I'll post a diff to the list for review before making any changes to the Mac runtime stuff. llvm-svn: 128274
* Simplify Mac runtime selection - it's the factory function's job to select ↵David Chisnall2011-03-221-1/+0
| | | | | | which class to produce, not CodeGenModule's. llvm-svn: 128109
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-3/+3
| | | | | | | | | | | | | | | | | - 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
* Add support for GNU runtime property set / get structure functions. Minor ↵David Chisnall2010-12-261-2/+4
| | | | | | 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
* Fixes an obscure bug in importd block variable layoutFariborz Jahanian2010-09-111-1/+1
| | | | | | | | 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
* Some early work for providing block layout info. Fariborz Jahanian2010-08-041-0/+4
| | | | | | for objective-c/c++ blocks (NeXt runtime). llvm-svn: 110213
* Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.John McCall2010-07-241-0/+6
| | | | | | Diagnose attempts to do this under the GNU or fragile NeXT runtimes. llvm-svn: 109298
* Adopt objc_assign_threadlocal() for __thread variables of GC types.Fariborz Jahanian2010-07-201-1/+2
| | | | | | Implements radar 8203301. llvm-svn: 108917
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Objective-c++ IRGen. Support for @selector expression asFariborz Jahanian2010-06-171-1/+1
| | | | | | an lvalue. Fixes PR7390. llvm-svn: 106235
* Patch adds support for copying of thoseFariborz Jahanian2010-06-151-1/+1
| | | | | | | | 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
* Push a return-value slot throughout ObjC message-send codegen. Will beJohn McCall2010-05-221-0/+2
| | | | | | | critical for ObjC++ correctness; hard to test independently of various required Sema changes, though. llvm-svn: 104422
* Changed signature of GenerateMessageSend() function to pass the ↵David Chisnall2010-04-281-1/+1
| | | | | | | | 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
* Add some API code for future work.Fariborz Jahanian2010-04-121-0/+3
| | | | llvm-svn: 101052
* IRgen: Move BitField LValues to just hold a reference to the CGBitFieldInfo.Daniel Dunbar2010-04-051-2/+1
| | | | | | | | | - Unfortunately, this requires some horrible code in CGObjCMac which always allocats a CGBitFieldInfo because we don't currently build a proper layout for Objective-C classes. It needs to be cleaned up, but I don't want the bit-field cleanups to be blocked on that. llvm-svn: 100474
* Minor include pruning.Benjamin Kramer2010-03-311-1/+0
| | | | llvm-svn: 100007
* Revert "Numerous changes to selector handling:", this breaks a whole bunch ofDaniel Dunbar2010-02-031-6/+0
| | | | | | working code, for no apparent reason. llvm-svn: 95244
* Numerous changes to selector handling:David Chisnall2010-02-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | - 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
* Created __builtin___NSStringMakeConstantString() builtin, which generates ↵David Chisnall2010-01-231-1/+1
| | | | | | constant Objective-C strings. llvm-svn: 94274
* Patch fixes a code gen. bug in generation of objc_assign_ivarFariborz Jahanian2009-09-241-1/+2
| | | | | | (objc GC's API). llvm-svn: 82724
* IRgen/ObjC: Make the target method decl available to GenerateMessageSendSuper.Daniel Dunbar2009-09-171-2/+9
| | | | llvm-svn: 82117
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-15/+15
| | | | llvm-svn: 81346
OpenPOWER on IntegriCloud