summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjCXX
Commit message (Collapse)AuthorAgeFilesLines
...
* Modify the tests to use attribute group references instead of listing theBill Wendling2013-02-202-8/+18
| | | | | | function attributes. llvm-svn: 175606
* Add the 'target-cpu' and 'target-features' attributes to functions.Bill Wendling2013-02-151-2/+2
| | | | | | | The back-end will use these values to reconfigure code generation for different features. llvm-svn: 175308
* Added test for r174461 that checks that the desired behavior also occurs in ↵Michael Gottesman2013-02-061-0/+8
| | | | | | | | ObjC++ alongside ObjC. \end paranoia. llvm-svn: 174471
* Destroy arrays and ARC fields when throwing out of ctors.John McCall2013-02-011-1/+40
| | | | | | | | Previously we were only handling non-array fields of class type. Testcases derived from a patch by WenHan Gu. llvm-svn: 174146
* Use the correct field to copy/dispose a __block variable.John McCall2013-01-221-0/+49
| | | | | | | | | | | | | | | We were previously hard-coding a particular field index. This was fine before (because we were obviously guaranteed the presence of a copy/dispose member) except for (1) alignment padding and (2) future extensions adding extra members to the header, such as the extended-layout pointer. Note that we only introduce the extended-layout pointer in the presence of structs. (We also seem to be introducing it even in the presence of an all-non-object layout, but that's a different potential issue.) llvm-svn: 173122
* objC block layout: Patch reorders block layout to Fariborz Jahanian2013-01-171-10/+11
| | | | | | produce more inline layout metadata. // rdar://12752901 llvm-svn: 172683
* Declare +new instead of -new in test.Fariborz Jahanian2013-01-101-1/+1
| | | | llvm-svn: 172126
* objectiveC++: When throwing c++ exception of Fariborz Jahanian2013-01-101-1/+17
| | | | | | | 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-0/+4
| | | | llvm-svn: 170354
* Revert "Added support for new property helpers (GNUstep runtime)."Benjamin Kramer2012-12-171-4/+0
| | | | | | This reverts commit r170344. Doesn't even compile. llvm-svn: 170351
* Added support for new property helpers (GNUstep runtime).David Chisnall2012-12-171-0/+4
| | | | llvm-svn: 170344
* Fix PR14474: don't emit debug info for interface types in -gline-tables-only ↵Alexey Samsonov2012-12-031-0/+25
| | | | | | mode. llvm-svn: 169138
* objective-C arc: load of a __weak object happens via call toFariborz Jahanian2012-11-271-1/+6
| | | | | | | | | | | objc_loadWeak. This retains and autorelease the weakly-refereced object. This hidden autorelease sometimes makes __weak variable alive even after the weak reference is erased, because the object is still referenced by an autorelease pool. This patch overcomes this behavior by loading a weak object via call to objc_loadWeakRetained(), followng it by objc_release at appropriate place, thereby removing the hidden autorelease. // rdar://10849570 llvm-svn: 168740
* Don't try to save the assigned value in a Objective-C property assignmentEli Friedman2012-11-131-6/+16
| | | | | | | | | if the type of the value is a non-trivial class type. Fixes PR14318. (There's a minor ObjC++ language change here: given that we can't save the value, the type of the assignment expression is void in such cases.) llvm-svn: 167884
* Minor fix to ObjC layout bitmap metadata. Found while I was trying toEli Friedman2012-11-061-3/+3
| | | | | | refactor the code. llvm-svn: 167436
* Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith2012-11-051-1/+1
| | | | | | | checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
* objective-C IRGen: for @implementation nested in Fariborz Jahanian2012-10-261-0/+17
| | | | | | | | | extern "C", its method definitions must be IRGen'ed before meta-data for class is generated. Otherwise, IRGen crashes (to say the least). // rdar://12581683 llvm-svn: 166809
* At -O0, prefer objc_storeStrong with a null new value to theJohn McCall2012-10-173-13/+9
| | | | | | | | | | | combination of a load+objc_release; this is generally better for tools that try to track why values are retained and released. Also use objc_storeStrong when copying a block (again, only at -O0), which requires us to do a preliminary store of null in order to compensate for objc_storeStrong's assign semantics. llvm-svn: 166085
* Remove invalid double colon in test case was previously ignored by FileCheck.Benjamin Kramer2012-09-181-1/+1
| | | | llvm-svn: 164167
* When performing a trivial copy of a C++ type, we must be careful notJohn McCall2012-08-211-14/+81
| | | | | | | | | | | to overwrite objects that might have been allocated into the type's tail padding. This patch is missing some potential optimizations where the destination is provably a complete object, but it's necessary for correctness. Patch by Jonathan Sauer. llvm-svn: 162254
* Teach Expr::HasSideEffects about all the Expr types, and fix a bug where itRichard Smith2012-08-071-24/+24
| | | | | | | | | | | | | | | | | | | was mistakenly classifying dynamic_casts which might throw as having no side effects. Switch it from a visitor to a switch, so it is kept up-to-date as future Expr nodes are added. Move it from ExprConstant.cpp to Expr.cpp, since it's not really related to constant expression evaluation. Since we use HasSideEffect to determine whether to emit an unused global with internal linkage, this has the effect of suppressing emission of globals in some cases. I've left many of the Objective-C cases conservatively assuming that the expression has side-effects. I'll leave it to someone with better knowledge of Objective-C than mine to improve them. llvm-svn: 161388
* Don't crash *or* insert a bogus autorelease when emitting aJohn McCall2012-07-311-0/+16
| | | | | | this-adjustment thunk in ARC++. llvm-svn: 161014
* Don't try to do RVO on block variables that refer to an enclosing local.Nico Weber2012-07-111-3/+18
| | | | | | | Fixes PR13314, clang crashing on blocks refering to an enclosing local when the enclosing function returns void. llvm-svn: 160089
* 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
OpenPOWER on IntegriCloud