summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjCXX
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix ObjC @encode for C++ classes w/virtual bases.Eli Friedman2013-09-181-0/+10
| | | | | | PR17142. llvm-svn: 190912
* Don't pass -O0 to clang_cc1, it is the default.Rafael Espindola2013-09-042-2/+2
| | | | llvm-svn: 189910
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-1530-103/+103
| | | | | | tests fail. llvm-svn: 188447
* Compute 'this' correctly for block in lambda.Eli Friedman2013-07-121-0/+18
| | | | | | | | | Using CurFuncDecl is both correct and simple compared to crawling the DeclContexts of the block. Fixes <rdar://problem/14415072>. llvm-svn: 186210
* Finish off mangling locals in block literals.Eli Friedman2013-07-101-4/+1
| | | | | | | Specifically, handle the case where the block is in a default argument in a class method. The mangling here follows what we do for lambdas. llvm-svn: 185991
* More fixes for block mangling.Eli Friedman2013-07-021-7/+7
| | | | | | | | | | | | Make sure we properly treat names defined inside a block as local names. There are basically three fixes here. One, correctly treat blocks as a context where we need to use local-name mangling using the new isLocalContainerContext helper. Two, make CXXNameMangler::manglePrefix handle local names in a consistent way. Three, extend CXXNameMangler::mangleLocalName so it can mangle a block correctly. llvm-svn: 185450
* Fix mangling for block literals.Eli Friedman2013-07-011-6/+32
| | | | | | | | | | | | | | | Blocks, like lambdas, can be written in contexts which are required to be treated as the same under ODR. Unlike lambdas, it isn't possible to actually take the address of a block, so the mangling of the block itself doesn't matter. However, objects like static variables inside a block do need to be mangled in a consistent way. There are basically three components here. One, block literals need a consistent numbering. Two, objects/types inside a block literal need to be mangled using it. Three, objects/types inside a block literal need to have their linkage computed correctly. llvm-svn: 185372
* Change mangling of objects inside block literals.Eli Friedman2013-06-241-4/+16
| | | | | | | | | | | | This changes the mangling of local static variables/etc. inside blocks to do something simple and sane. This avoids depending on the way we mangle blocks, which isn't really appropriate here. John, please take a look at this to make sure the mangling I chose is sane. Fixes <rdar://problem/14074423>. llvm-svn: 184780
* Introduce a new mangling for protocol-qualified ObjC types in C++. This allowsEli Friedman2013-06-183-5/+25
| | | | | | | | | | | | to provide proper overloading, and also prevents mangling conflicts with template arguments of protocol-qualified type. This is a non-backward-compatible mangling change, but per discussion with John, the benefits outweigh this cost. Fixes <rdar://problem/14074822>. llvm-svn: 184250
* Add a missing testcase for ObjC ivar encoding for a C++ class with a vptr.Eli Friedman2013-06-171-0/+13
| | | | | | Found by skimming over lcov report. llvm-svn: 184150
* Followup to r183931 to fix the lambda conversion-to-block-pointer member.Eli Friedman2013-06-131-1/+10
| | | | llvm-svn: 183942
* Correctly emit certain implicit references to 'self' even withinJohn McCall2013-05-031-0/+22
| | | | | | | | | | | | | | | | | | a lambda. Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation functions. Fix that by generally improving getNonClosureContext to look through lambdas and captured statements but only report code contexts, which is generally what's wanted. Audit uses of CurFuncDecl and getNonClosureAncestor for correctness. Bug #2 is that lambdas weren't specially mapping 'self' when inside an ObjC method. Fix that by removing the requirement for that and using the normal EmitDeclRefLValue path in LoadObjCSelf. rdar://13800041 llvm-svn: 181000
* Drop ObjCIndirectCopyRestoreExprs during template instantiation.John McCall2013-04-111-0/+22
| | | | | | | | | It's a kind of implicit conversion, which we generally drop, but more importantly it's got very specific placement requirements. rdar://13617051 llvm-svn: 179254
* Don't crash when mangling types defined in ObjC class extensions.John McCall2013-04-101-1/+25
| | | | | | | | | The original test case here was mangling a type name for TBAA, but we can provoke this in C++11 easily enough. rdar://13434937 llvm-svn: 179153
* In ObjC++ on legacy runtimes, push an EH cleanup as well asJohn McCall2013-04-031-0/+80
| | | | | | | | | | | | a normal cleanup when entering a @try or @synchronized to ensure that we clean that up if an exception is triggered. Apparently GCC did this, so it's hard to argue that we shouldn't do at least as much. rdar://12364847 llvm-svn: 178599
* Under ARC, when we're passing the address of a strong variableJohn McCall2013-03-231-0/+2
| | | | | | | | | | | | to an out-parameter using the indirect-writeback conversion, and we copied the current value of the variable to the temporary, make sure that we register an intrinsic use of that value with the optimizer so that the value won't get released until we have a chance to retain it. rdar://13195034 llvm-svn: 177813
* Sema: Preserve attributes on parameters in instantiated function templates.Jordan Rose2013-03-081-0/+48
| | | | | | | | | | | | | | | | | | This was causing correctness issues for ARC and the static analyzer when a function template has "consumed" Objective-C object parameters (i.e. parameters that will be released by the function before returning). The fix is threefold: (1) Actually copy over the attributes from old ParmVarDecls to new ones. (2) Have Sema::BuildFunctionType only work for building FunctionProtoTypes, which it was doing anyway. This allows us to pass an ExtProtoInfo instead of a plain ExtInfo and several flags. (3) Drop param attributes as part of StripImplicitInstantiation, which is used when an implicit instantiation is followed by an explicit one. <rdar://problem/12685622> llvm-svn: 176728
* Correction to r176432: the bug actually fixed was <rdar://13025708>.John McCall2013-03-041-1/+1
| | | | llvm-svn: 176433
* Centralize and refine the __unknown_anytype argument rulesJohn McCall2013-03-041-0/+20
| | | | | | | | | and be sure to apply them whether or not the debugger gave us a method declaration. rdar://12565338 llvm-svn: 176432
* Perform the receiver-expression transformations regardless ofJohn McCall2013-03-011-0/+24
| | | | | | | | | | | | | | whether we already have a method. Fixes a bug where we were failing to properly contextually convert a message receiver during template instantiation. As a side-effect, we now actually perform correct method lookup after adjusting a message-send to integral or non-ObjC pointer types (legal outside of ARC). rdar://13305374 llvm-svn: 176339
* Reapply r176133 with testcase fixes.Bill Wendling2013-02-271-9/+4
| | | | llvm-svn: 176145
* Unify clang/llvm attributes for asan/tsan/msan (Clang part)Kostya Serebryany2013-02-261-2/+2
| | | | | | | | | | | | | | | | | | | These are two related changes (one in llvm, one in clang). LLVM: - rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode) - rename thread_safety => sanitize_thread - rename no_uninitialized_checks -> sanitize_memory CLANG: - add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis)) - add __attribute__((no_sanitize_thread)) - add __attribute__((no_sanitize_memory)) for S in address thread memory If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not set llvm attribute sanitize_S llvm-svn: 176076
* Revert "Add more attributes from the command line to functions."Anna Zaks2013-02-251-4/+9
| | | | | | | | This reverts commit 176009. The commit is a likely cause of several buildbot failures. llvm-svn: 176044
* Add more attributes from the command line to functions.Bill Wendling2013-02-251-9/+4
| | | | | | | This is an ongoing process. Any command line option which a back-end cares about should be added here. llvm-svn: 176009
* Update to use references to attribute groups instead of listing the ↵Bill Wendling2013-02-222-15/+19
| | | | | | attributes on the call/invoke instructions. llvm-svn: 175878
* objective-C arc IR-gen. Retaining of strongFariborz Jahanian2013-02-211-2/+3
| | | | | | | | | | arguments in function prologue is done with objc_StoreStrong to pair it with similar objc_StoreStrong for release in function epilogue. This is done with -O0 only. // rdar://13145317 llvm-svn: 175698
* Attempt to clean up tests for non-X86 platforms.Bill Wendling2013-02-201-6/+6
| | | | llvm-svn: 175652
* 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
OpenPOWER on IntegriCloud