summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCGNU.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce new queries on ObjCRuntime for how to interpret subscriptsJohn McCall2012-07-311-2/+5
| | | | | | | | on object pointers and whether pointer arithmetic on object pointers is supported. Make ObjFW interpret subscripts as pseudo-objects. Based on a patch by Jonathan Schleifer. llvm-svn: 161028
* Add the ObjFW runtime. Patch by Jonathan Schleifer!John McCall2012-07-121-5/+32
| | | | llvm-svn: 160102
* Rename the GCC Objective-C runtime to gcc from gnu-fragile and the GNUstepDavid Chisnall2012-07-031-2/+2
| | | | | | runtime to gnustep from gnu. Fix EH for the GCC runtime. llvm-svn: 159684
* Restructure how the driver communicates information about theJohn McCall2012-06-201-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. llvm-svn: 158793
* More doxygen/documentation cleanups.James Dennett2012-06-131-5/+5
| | | | | | | | | | | | | | | | | | This reduces the number of warnings generated by Doxygen by about 100 (roughly 10%). Issues addressed: (1) Primarily, backslash-escaped "@foo" and "#bah" in Doxygen comments when they're not supposed to be Doxygen commands or links, and similarly for "<baz>" when it's not intended as as HTML tag; (2) Changed some \t commands (which don't exist) to \c ("to refer to a word of code", as the Doxygen manual says); (3) \precondition becomes \pre; (4) When touching comments, deleted a couple of spurious spaces in them; (5) Changed some \n and \r to \\n and \\r; (6) Fixed one tiny typo: #pragms -> #pragma. This patch touches documentation/comments only. llvm-svn: 158422
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-2/+2
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-3/+3
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Revert r154321, pending more discussion.David Chisnall2012-04-091-15/+0
| | | | llvm-svn: 154327
* Add -fobjc-trace to emit a call before and after each Objective-C message sendDavid Chisnall2012-04-091-0/+15
| | | | | | for hooking in code flow visualisation applications. llvm-svn: 154321
* Teach Clang about PIE compilations. This is the first step of PR12380.Chandler Carruth2012-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, this patch cleans up the parsing of the PIC and PIE family of options in the driver. The existing logic failed to claim arguments all over the place resulting in kludges that marked the options as unused. Instead actually walk all of the arguments and claim them properly. We now treat -f{,no-}{pic,PIC,pie,PIE} as a single set, accepting the last one on the commandline. Previously there were lots of ordering bugs that could creep in due to the nature of the parsing. Let me know if folks would like weird things such as "-fPIE -fno-pic" to turn on PIE, but disable full PIC. This doesn't make any sense to me, but we could in theory support it. Options that seem to have intentional "trump" status (-static, -mkernel, etc) continue to do so and are commented as such. Next, a -pie-level flag is threaded into the frontend, rigged to a language option, and handled preprocessor, setting up the appropriate defines. We'll now have the correct defines when compiling with -fpie. The one place outside of the preprocessor that was inspecting the PIC level (as opposed to the relocation model, which is set and handled separately, yay!) is in the GNU ObjC runtime. I changed it to exactly preserve existing behavior. If folks want to change its behavior in the face of PIE, they can do that in a separate patch. Essentially the only functionality changed here is the preprocessor defines and bug-fixes to the argument management. Tests have been updated and extended to test all of this a bit more thoroughly. llvm-svn: 154291
* zext ivar offsets if required (GNU runtimes).David Chisnall2012-04-061-1/+4
| | | | llvm-svn: 154175
* Silence dead store warning, and fix indentation.Ted Kremenek2012-04-041-8/+9
| | | | llvm-svn: 153986
* Add missing bitcast that was breaking Objective-C++ exception typeinfo ↵David Chisnall2012-03-201-1/+2
| | | | | | (GNUstep runtime). llvm-svn: 153090
* [Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() ↵Argyrios Kyrtzidis2012-03-131-3/+3
| | | | | | | | | iterators instead of ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use even if the caller did not check that the interface is a definition. llvm-svn: 152597
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-15/+15
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+7
| | | | | | | | | | | | | 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
* Use an ArrayRef when we can instead of passing in a SmallVectorImpl reference.Bill Wendling2012-02-221-26/+24
| | | | llvm-svn: 151150
* Whether an argument is required (in contrast with being anJohn McCall2012-02-171-22/+13
| | | | | | | | | | | | | | | | | | | | | 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
* reapply the patches reverted in r149477, which enable ConstantDataArray.Chris Lattner2012-02-051-1/+1
| | | | llvm-svn: 149801
* size() == 0 -> empty().David Chisnall2012-02-011-1/+1
| | | | | | Spotted by rjmcall. llvm-svn: 149526
* Revert r149363 which was part a series of commits that were reverted in llvmArgyrios Kyrtzidis2012-02-011-1/+1
| | | | | | | | | | | | | | | | | commit 149470. This fixes test/CodeGen/PR3589-freestanding-libcalls.c. Original log: ConstantArray::get() (for strings) is going away, use ConstantDataArray::getString instead. Many instances of ConstantArray::get() could be moved to use more efficient ConstantDataArray methods that avoid a ton of intermediate Constant*'s for each element (e.g. GetConstantArrayFromStringLiteral). I don't plan on doing this in the short-term though. llvm-svn: 149477
* Support @compatibility_alias at run time (GNUstep Runtime)David Chisnall2012-01-311-1/+54
| | | | | | Patch by Niels Grewe! llvm-svn: 149401
* ConstantArray::get() (for strings) is going away, useChris Lattner2012-01-311-1/+1
| | | | | | | | | | | | ConstantDataArray::getString instead. Many instances of ConstantArray::get() could be moved to use more efficient ConstantDataArray methods that avoid a ton of intermediate Constant*'s for each element (e.g. GetConstantArrayFromStringLiteral). I don't plan on doing this in the short-term though. llvm-svn: 149363
* Remove unnecessary default cases in switches over enums.David Blaikie2012-01-171-2/+0
| | | | | | This allows -Wswitch-enum to find switches that need updating when these enums are modified. llvm-svn: 148281
* objc++: some declarations related to atomicFariborz Jahanian2012-01-061-0/+4
| | | | | | | properties of c++ object types with non-trivial assignment copy. Not used yet. // rdar://6137845 llvm-svn: 147666
* Restore r147493 and remove the part of the test that was checking the wrong ↵David Chisnall2012-01-041-6/+32
| | | | | | thing. llvm-svn: 147530
* Revert r147493. It broke test/CodeGenObjC/constant-strings.m.Rafael Espindola2012-01-041-32/+6
| | | | llvm-svn: 147511
* Initialise constant Objective-C string isa pointers with a weak reference to ↵David Chisnall2012-01-031-6/+32
| | | | | | the class, so that they are usable in +load methods if the string class has been compiled with clang - if it's been compiled with GCC, the ABI makes this impossible. (GNU runtimes) llvm-svn: 147493
* Introduce the core infrastructure needed to model redeclaration chainsDouglas Gregor2012-01-011-0/+5
| | | | | | | | | | | | | | | for Objective-C protocols, including: - Using the first declaration as the canonical declaration - Using the definition as the primary DeclContext - Making sure that all declarations have a pointer to the definition data, and that we know which declaration is the definition - Serialization support for redeclaration chains and for adding definitions to already-serialized declarations. However, note that we're not taking advantage of much of this code yet, because we're still re-using ObjCProtocolDecls. llvm-svn: 147410
* Fix -forwardingTargetForSelector: (GNUstep runtime) which was broken for theDavid Chisnall2011-12-011-0/+2
| | | | | | old dispatch mechanism when I introduced the new one. llvm-svn: 145609
* It turns out that the Objective-C message lookup functions can throw ↵David Chisnall2011-10-281-11/+14
| | | | | | exceptions after all... llvm-svn: 143205
* Change an int64_t to an intptr_t so that we don't end up with crashes in the ↵David Chisnall2011-10-251-8/+8
| | | | | | back end on large classes on 32-bit. llvm-svn: 142918
* Remove debugging printfs that some idiot left in.David Chisnall2011-10-241-3/+0
| | | | llvm-svn: 142796
* Enable experimental support for objc_msgSend with GNUstep ObjC runtime.David Chisnall2011-10-241-9/+32
| | | | llvm-svn: 142795
* Apparently getPtrToInt() takes an explicit type parameter to allow you to ↵David Chisnall2011-10-081-3/+10
| | | | | | generate invalid bitcode, not so that it can actually produce a value of this type. This should fix PR11085. llvm-svn: 141482
* Fix warning on MSVC. Patch by Aaron Ballman.Eli Friedman2011-10-081-1/+1
| | | | llvm-svn: 141467
* Add bitmaps for strong / weak ivar layout (GNUstep runtime).David Chisnall2011-10-041-18/+102
| | | | llvm-svn: 141085
* When performing an @throw in ARC, retain + autoreleaseJohn McCall2011-10-011-1/+1
| | | | | | | the pointer, being sure to do so before running cleanups associated with that full-expression. rdar://10042689 llvm-svn: 140945
* de-tmpify clang.Benjamin Kramer2011-09-271-2/+1
| | | | llvm-svn: 140637
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Change "ivar" to true for a boolean function argument. Since string ↵Richard Trieu2011-09-211-2/+3
| | | | | | literals are cast to true, this should no effect on behavior. llvm-svn: 140231
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-5/+5
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* switch clang to use the new-new way of creating llvm::StructType's.Chris Lattner2011-08-121-2/+1
| | | | llvm-svn: 137472
* Fix typo so we don't use the wrong function for ending ObjC++ catch blocks ↵David Chisnall2011-08-081-1/+1
| | | | | | (GNU runtimes) llvm-svn: 137052
* Fix linkage type for tentative definition of ivar offset variables (GNUstep ↵David Chisnall2011-08-011-2/+2
| | | | | | runtime) llvm-svn: 136628
* Remove some unnecessary single element array temporaries.Jay Foad2011-07-291-8/+5
| | | | llvm-svn: 136461
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-67/+66
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.Jordy Rose2011-07-221-14/+10
| | | | | | | | | This was previously not-const only because it has to lazily construct a chain of ivars the first time it is called (and after the chain is invalidated). In practice, all the clients were just const_casting their const Decls; all those now-unnecessary const_casts have been removed. llvm-svn: 135741
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-211-5/+5
| | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-20/+20
| | | | llvm-svn: 135370
OpenPOWER on IntegriCloud