summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjCXX
Commit message (Collapse)AuthorAgeFilesLines
...
* block literal irgen: several improvements on naming blockFariborz Jahanian2012-06-263-14/+14
| | | | | | | | | | | | literal helper functions. All helper functions (global and locals) use block_invoke as their prefix. Local literal helper names are prefixed by their enclosing mangled function names. Blocks in non-local initializers (e.g. a global variable or a C++11 field) are prefixed by their mangled variable name. The descriminator number added to end of the name starts off with blank (for first block) and _<N> (for the N+2-th block). llvm-svn: 159206
* Restructure how the driver communicates information about theJohn McCall2012-06-2020-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | 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
* When @encode'ing a C++ class that has empty base classes, we can endDouglas Gregor2012-04-271-0/+14
| | | | | | | up with gaps when the class inherits from the same empty base class more than once. Fixes <rdar://problem/11324167>. llvm-svn: 155738
* Fix a Sema invariant bug that I recently introduced involvingJohn McCall2012-04-061-0/+11
| | | | | | | | | the template instantiation of statement-expressions. I think it was jyasskin who had a crashing testcase in this area; hopefully this fixes it and he can find his testcase and check it in. llvm-svn: 154189
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-064-0/+253
| | | | | | | | | | | | | 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
* Make CodeGenFunction::EmitBlockCopyAndAutorelease actually do what its name ↵Eli Friedman2012-03-011-0/+2
| | | | | | says. llvm-svn: 151853
* Implement "optimization" for lambda-to-block conversion which inlines the ↵Eli Friedman2012-03-011-0/+19
| | | | | | | | generated block literal for lambdas which are immediately converted to block pointer type. This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap. Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal. With ARC, the effect is much less obvious because the lifetime of blocks is already managed. llvm-svn: 151797
* Basic coverage test for conversion-to-block-pointer for lambda expressions.Eli Friedman2012-02-281-0/+18
| | | | llvm-svn: 151616
* No need to go to object file, -emit-llvm is sufficient to see if clangEric Christopher2012-02-211-1/+1
| | | | | | itself crashes. llvm-svn: 151095
* Redirect the output to /dev/null. This prevents the output from clutteringRichard Trieu2012-02-211-1/+1
| | | | | | up the build enviroment. llvm-svn: 151087
* Add a test case for r150976.Nico Weber2012-02-211-0/+41
| | | | llvm-svn: 151027
* Elide copy construction in new expressions. PR11757.Eli Friedman2012-02-161-2/+0
| | | | llvm-svn: 150738
* Move the code that sets the AddressSafetyAlexander Potapenko2012-02-021-0/+20
| | | | | | | | | | attribute into CodeGenModule::SetLLVMFunctionAttributesForDefinition(). Previously it resided in CodeGenModule::GetOrCreateLLVMFunction, which for some reason wasn't called for ObjC class methods, see http://code.google.com/p/address-sanitizer/issues/detail?id=33 llvm-svn: 149605
* When initializing a catch variable in ARC, be sure to emit retainsJohn McCall2012-01-171-0/+85
| | | | | | | | | or whatever else is required for the initialization instead of assuming it can be done with a simple store. Fixes PR11732. llvm-svn: 148325
* objc++: patch for IRgen for atomic properties ofFariborz Jahanian2012-01-101-0/+56
| | | | | | | c++ objects with non-trivial assignment/copy functions. Also, one additional sema check. // rdar://6137845 llvm-svn: 147817
* objc++: more code gen stuff for atomic property api,Fariborz Jahanian2012-01-061-1/+1
| | | | | | | | currently turned off. // rdar://6137845 Also, fixes a test case which should be nonatomic under new API. llvm-svn: 147691
* Fixes a code gen bug for setter code for a property ofFariborz Jahanian2012-01-051-0/+31
| | | | | | | | c++ object reference type with trivial copy constructor. This causes an assert crash and bad code gen. when assert is off. // rdar://6137845 llvm-svn: 147573
* Make sure that we infer __strong, etc. when we instantiate variablesDouglas Gregor2011-12-101-0/+17
| | | | | | under ARC. Fixes <rdar://problem/10530209>. llvm-svn: 146307
* Use the right CHECK prefix so that we actually do this checking. ↵Douglas Gregor2011-12-101-13/+13
| | | | | | Miraculously, this hasn't broken llvm-svn: 146303
* When we manage to re-use an expression during tree transformation (=Douglas Gregor2011-12-101-0/+15
| | | | | | | | template instantiation), and that expression might produce a temporary, invoke MaybeBindToTemporary. Otherwise, we forget to destroy objects, release objects, etc. Fixes <rdar://problem/10531073>. llvm-svn: 146301
* Fix the instantiation of pseudo-object expressions. This is aJohn McCall2011-11-301-0/+42
| | | | | | | | | really bad way to go about this, but I'm not sure there's a better choice without substantial changes to TreeTransform --- most notably, preserving implicit semantic nodes instead of discarding and rebuilding them. llvm-svn: 145480
* obj-c++: Fix a IRGen crash when getter is a reference type.Fariborz Jahanian2011-10-171-0/+28
| | | | | | Fix is in Sema. // rdar://10153365 llvm-svn: 142249
* obj-c++: allow the getter/setter to return/take parametersFariborz Jahanian2011-10-151-0/+12
| | | | | | by reference. // rdar://10188258 llvm-svn: 142075
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-132-2/+2
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Switch diagnostic text from "C++0x" over to "C++11".Douglas Gregor2011-10-121-2/+2
| | | | | | | | We'd also like for "C++11" or "c++11" to be used for the warning groups, but without removing the old warning flags. Patches welcome; I've run out of time to work on this today. llvm-svn: 141801
* objc++: Accessing explicit property of reference type need Fariborz Jahanian2011-10-031-0/+23
| | | | | | not bind to a temporary. Fixes //rdar://10188258 llvm-svn: 141009
* Make -fobjc-nonfragile-abi the -cc1 default, since it's theJohn McCall2011-10-0231-31/+31
| | | | | | | | | | | | | | | | | | | increasingly prevailing case to the point that new features like ARC don't even support the fragile ABI anymore. This required a little bit of reshuffling with exceptions because a check was assuming that ObjCNonFragileABI was only being set in ObjC mode, and that's actually a bit obnoxious to do. Most, though, it involved a perl script to translate a ton of test cases. Mostly no functionality change for driver users, although there are corner cases with disabling language-specific exceptions that we should handle more correctly now. llvm-svn: 140957
* objc arc: allow objc_returns_inner_pointer on methods that return Fariborz Jahanian2011-09-301-0/+22
| | | | | | | a reference type, since inner reference is much like an inner pointer. // rdar://10139365 llvm-svn: 140880
* Fix assertion hit when @encoding C++ classes. rdar://10172840 & ↵Argyrios Kyrtzidis2011-09-261-0/+20
| | | | | | http://llvm.org/PR10990 llvm-svn: 140542
* Throw the switch to convert clang to the new exception handling model!Bill Wendling2011-09-192-2/+6
| | | | | | | | | | | | | This model uses the 'landingpad' instruction, which is pinned to the top of the landing pad. (A landing pad is defined as the destination of the unwind branch of an invoke instruction.) All of the information needed to generate the correct exception handling metadata during code generation is encoded into the landingpad instruction. The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic call. It's lowered in much the same way as the intrinsic is. llvm-svn: 140049
* Handle reference properties correctly in the trivial-getter check.John McCall2011-09-131-15/+35
| | | | llvm-svn: 139585
* Implement the Named Return Value Optimization (NRVO) for blocks.Douglas Gregor2011-09-061-1/+12
| | | | llvm-svn: 139178
* Implement the Named Return Value Optimization (NRVO) for Objective-C++Douglas Gregor2011-09-061-0/+21
| | | | | | methods. Fixes PR10835 / <rdar://problem/10050178>. llvm-svn: 139175
* Slight optimization enabled by the previous assert: John McCall2011-08-261-2/+3
| | | | | | emit all gl-value arguments as reference bindings. llvm-svn: 138655
* Fix a bug in objc @encoding of C++ classes.Argyrios Kyrtzidis2011-08-221-0/+21
| | | | llvm-svn: 138235
* Migrate and update:Eric Christopher2011-08-203-0/+33
| | | | | | | | | | 2007-10-03-MetadataPointers.mm 2010-08-04-Template.mm 2010-08-06-X.Y-syntax.mm from llvm/test/FrontendObjC++. llvm-svn: 138167
* Fix a couple of problems with initialization and assignment toJohn McCall2011-07-281-6/+10
| | | | | | | | | | | __block variables where the act of initialization/assignment itself causes the __block variable to be copied to the heap because the variable is of block type and is being assigned a block literal which captures the variable. rdar://problem/9814099 llvm-svn: 136337
* Clean up the analysis of the collection operand to ObjCJohn McCall2011-07-271-0/+45
| | | | | | | | | | | for-in statements; specifically, make sure to close over any temporaries or cleanups it might require. In ARC, this has implications for the lifetime of the collection, so emit it with a retain and release it upon exit from the loop. rdar://problem/9817306 llvm-svn: 136204
* fix rdar://9780211 - Clang crashes with an assertion failure building ↵Chris Lattner2011-07-201-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | WKView.mm from WebKit This is something of a hack, the problem is as follows: 1. we instantiate both copied of RetainPtr with the two different argument types (an id and protocol-qualified id). 2. We refer to the ctor of one of the instantiations when introducing global "x", this causes us to emit an llvm::Function for a prototype whose "this" has type "RetainPtr<id<bork> >*". 3. We refer to the ctor of the other instantiation when introducing global "y", however, because it *mangles to the same name as the other ctor* we just use a bitcasted version of the llvm::Function we previously emitted. 4. We emit deferred declarations, causing us to emit the body of the ctor, however the body we emit is for RetainPtr<id>, which expects its 'this' to have an IR type of "RetainPtr<id>*". Because of the mangling collision, we don't have this case, and explode. This is really some sort of weird AST invariant violation or something, but hey a bitcast makes the pain go away. llvm-svn: 135572
* Okay, that rule about zero-length arrays applies to destroyingJohn McCall2011-07-131-2/+2
| | | | | | them, too. llvm-svn: 135038
* Switch delete[] IR-generation over to the destroy framework,John McCall2011-07-131-8/+17
| | | | | | which implicitly makes it EH-safe as well. llvm-svn: 135025
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-121-4/+11
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* Fix the clang bootstrap and Jay's testcase from llvm-dev by being completelyChris Lattner2011-07-101-4/+4
| | | | | | | | | | conservative when converting a functiontype to IR when in a "pointer within a struct" context. This has the unfortunate sideeffect of compiling all function pointers inside of structs into "{}*" which, though correct, is ugly. This has the positive side effect of being correct, and it is pretty straight-forward to improve on this. llvm-svn: 134861
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-092-4/+5
| | | | llvm-svn: 134831
* In ARC, reclaim all return values of retainable type, not just thoseJohn McCall2011-07-071-8/+12
| | | | | | | | | | | | where we have an immediate need of a retained value. As an exception, don't do this when the call is made as the immediate operand of a __bridge retain. This is more in the way of a workaround than an actual guarantee, so it's acceptable to be brittle here. rdar://problem/9504800 llvm-svn: 134605
* Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2011-07-065-5/+5
| | | | | | | | | | | | structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
* Do not apply the ARC move optimization to 'const'-qualified xvalues.John McCall2011-06-251-0/+12
| | | | llvm-svn: 133861
* Support for catching objc pointer objects in c++ catch-statementFariborz Jahanian2011-06-231-1/+16
| | | | | | 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-0/+33
| | | | | | in Darwin's fragile abi mode. // rdar://8940528 llvm-svn: 133639
* Implement the C++0x move optimization for Automatic Reference CountingDouglas Gregor2011-06-221-0/+63
| | | | | | | | objects, so that we steal the retain count of a temporary __strong pointer (zeroing out that temporary), eliding a retain/release pair. Addresses <rdar://problem/9364932>. llvm-svn: 133621
OpenPOWER on IntegriCloud