summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjCXX
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Revert r234581, it might have caused a few miscompiles in Chromium."David Majnemer2015-04-224-0/+55
| | | | | | | | This reverts commit r234700. It turns out that the lifetime markers were not the cause of Chromium failing but a bug which was uncovered by optimizations exposed by the markers. llvm-svn: 235553
* [opaque pointer types] Explicit non-pointer type for call expressionsDavid Blaikie2015-04-162-3/+3
| | | | | | (migration for recent LLVM change to textual IR for calls) llvm-svn: 235147
* Revert r234581, it might have caused a few miscompiles in Chromium.Nico Weber2015-04-114-55/+0
| | | | | | | If the revert helps, I'll get a repro this Monday. Else I'll put the change back in. llvm-svn: 234700
* Remove threshold for inserting lifetime markers for named temporariesArnaud A. de Grandmaison2015-04-104-0/+55
| | | | | | | | | | | | | | | | | | | Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. My previous commit (r222993) was not handling debuginfo correctly, but this could only be seen with some asan tests. Basically, lifetime markers are just instrumentation for the compiler's usage and should not affect debug information; however, the cleanup infrastructure was assuming it contained only destructors, i.e. actual code to be executed, and was setting the breakpoint for the end of the function to the closing '}', and not the return statement, in order to show some destructors have been called when leaving the function. This is wrong when the cleanups are only lifetime markers, and this is now fixed. llvm-svn: 234581
* Add a bunch of missing "CHECK" colons in tests. NFC.Ahmed Bougacha2015-03-141-1/+1
| | | | llvm-svn: 232237
* Test case updates for explicit type parameter to the gep operatorDavid Blaikie2015-03-131-1/+1
| | | | llvm-svn: 232187
* DebugInfo: Move new hierarchy into place (clang)Duncan P. N. Exon Smith2015-03-031-6/+14
| | | | | | | Update testcases for LLVM change in r231082 to use the new debug info hierarchy. llvm-svn: 231083
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-2719-60/+60
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-2711-34/+34
| | | | llvm-svn: 230783
* Add a testcase that exercises DIBuilder's handling of cyclic debug info nodes.Adrian Prantl2015-02-171-0/+21
| | | | | | rdar://problem/19839612 llvm-svn: 229522
* Remove trailing whitespace to make test compatible with typeless pointer ↵David Blaikie2015-02-151-2/+2
| | | | | | migration llvm-svn: 229273
* Remove trailing whitespace getting in the way of near-future getelementptr ↵David Blaikie2015-02-141-1/+1
| | | | | | change updates llvm-svn: 229197
* Merge ArtificialLocation into ApplyDebugLocation and make a clearAdrian Prantl2015-02-031-0/+24
| | | | | | | | | | | | | | | | distinction between the different use-cases. With the previous default behavior we would occasionally emit empty debug locations in situations where they actually were strictly required (= on invoke insns). We now have a choice between defaulting to an empty location or an artificial location. Specifically, this fixes a bug caused by a missing debug location when emitting C++ EH cleanup blocks from within an artificial function, such as an ObjC destroy helper function. rdar://problem/19670595 llvm-svn: 228003
* Emit DeferredDeclsToEmit in a DFS order.Rafael Espindola2015-01-224-39/+40
| | | | | | | | | | | | | | Currently we emit DeferredDeclsToEmit in reverse order. This patch changes that. The advantages of the change are that * The output order is a bit closer to the source order. The change to test/CodeGenCXX/pod-member-memcpys.cpp is a good example. * If we decide to deffer more, it will not cause as large changes in the estcases as it would without this patch. llvm-svn: 226751
* IR: Move MDLocation into place (clang testcases)Duncan P. N. Exon Smith2015-01-141-2/+2
| | | | | | Update testcases to match LLVM change in r226048. llvm-svn: 226049
* DebugInof: Correct the location of exception cleanups in global ctors/dtors ↵David Blaikie2015-01-141-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | and ObjC methods Without setting the CurEHLocation these cleanups would be attributed to whatever the last active debug line location was (the 'fn' call in the included test cases). By setting CurEHLocation correctly the line information is improved/corrected. This quality bug turned into a crasher with r225000 when, instead of allowing the last location to persist, it would be zero'd out. This could lead to a function call (such as the dtor) being made without a debug location - if that call was subsequently inlined (and the caller and callee had debug info, just not the call instruction) the inliner would violate important constraints about the debug location chains by not updating the inlined instructions to chain up to the callee locations. So, by fixing this bug, I am addressing the assertion failures introduced by r225000 and should be able to recommit that patch with impunity... llvm-svn: 225955
* DebugInfo: Correct the location of EH cleanup for blocksDavid Blaikie2015-01-131-0/+16
| | | | | | | | | | | | | | | | | | | | | | | This was previously piggybacking on whatever happened to be the last location set on CGDebugInfo/DIBuilder, which was wrong (it was often the current location, such as the 'fn()' call site, not the end of the block). With my improvements to set/unset the location in a scoped manner (r225000) this went from a bad quality situation, to a crash. Fixing this goes part-way to unblocking the recommit of r225000. It's likely that any call to CodeGenFunction::StartFunction without the CurEHLocation set represents a similar bug or risk of a bug. Perhaps there are some callers that know they won't generate EH cleanups, but I'm not sure. I considered a generic catch-fix in StartFunction (just fallback to the GlobalDecl's location) but that seemed like it'd mask bugs where the EH location shouldn't be the same as the decl's location (& indeed by not using that stop-gap I found this bug). We'll see how long I can hold out on the generic catch-all. I might eventually be able to add an assertion in. llvm-svn: 225845
* Have the driver and the target code agree on what the default ABIEric Christopher2014-12-051-12/+11
| | | | | | | | | is for each machine. Fix up darwin tests that were testing for aapcs on armv7-ios when the actual ABI is apcs. Should be no user visible change without -cc1. llvm-svn: 223429
* Revert "Remove threshold for lifetime marker insertion of named temporaries"Arnaud A. de Grandmaison2014-12-014-57/+2
| | | | | | Revert r222993 while I investigate some MemorySanitizer failures. llvm-svn: 222995
* Remove threshold for lifetime marker insertion of named temporariesArnaud A. de Grandmaison2014-12-014-2/+57
| | | | | | | | | Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. llvm-svn: 222993
* AST: Consider pseudo-struct builtin types as substitutableDavid Majnemer2014-11-281-0/+4
| | | | | | | | We didn't consider types like ObjCSel as a substitution candidate. This fixes PR21688. llvm-svn: 222941
* Update Clang tests that run the LLVM optimizer to reflect the changedChandler Carruth2014-11-251-8/+7
| | | | | | canonicalization in r222748. No interesting functionality changed here. llvm-svn: 222749
* Fixes test.Fariborz Jahanian2014-11-131-1/+1
| | | | llvm-svn: 221843
* [Objective-C++ IRGen] do not generate .cxx_construct Fariborz Jahanian2014-11-121-0/+13
| | | | | | | for class that contains trivially-constructible struct ivar. rdar://18950072 llvm-svn: 221823
* Don't manually insert L prefixes.Rafael Espindola2014-11-067-12/+12
| | | | | | Simply marking the symbol private conveys the desire to hide them to LLVM. llvm-svn: 221451
* Objective-C. revert patch for rdar://17554063.Fariborz Jahanian2014-10-282-17/+5
| | | | llvm-svn: 220812
* test: correct an overzealous search-and-replaceSaleem Abdulrasool2014-10-241-2/+2
| | | | | | | The temporary initialized is referenced as %0, not as the auto-release pool. Fixes R+A tests. llvm-svn: 220593
* CodeGen: correct materialize temporary aggregates in ARC modeSaleem Abdulrasool2014-10-241-0/+57
| | | | | | | | | | | | | | | | | | Avoid an assertion when materializing a lifetime type aggregate temporary. When performing CodeGen for ObjC++, we could generate a lifetime-only aggregate temporary by using an initializer list (which is effectively an array). We would reach through the temporary expression, fishing out the inner expression. If this expression was a lifetime expression, we would attempt to emit this as a scalar. This would eventually result in an assertion as the emission would eventually assert that the expression being emitted has a scalar evaluation kind. Add a case to handle the aggregate expressions. Use the EmitAggExpr to emit the aggregate expression rather than the EmitScalarInit. Addresses PR21347. llvm-svn: 220590
* test: add -std=c++11Saleem Abdulrasool2014-10-241-1/+1
| | | | | | | This test uses C++11 features (r-value references) in ObjC++. Add a -std=c++11 to silence a warning. NFC. llvm-svn: 220586
* DebugInfo: Don't leak location information from one function into the ↵David Blaikie2014-10-141-1/+6
| | | | | | | | | | | | | | | | | | | | | | prologue of the next function. CodeGenFunction objects aren't really designed to be reused for more than one function, and doing so can leak debug info location information from one function into the prologue of the next. Add an assertion in to catch reuses of CodeGenFunction, which surprisingly only caught the ObjC atomic getter/setter cases. Fix those and add a test to demonstrate the issue. The test is a bit slim, because we're just testing for the absence of a debug location on the prologue instructions, which by itself probably wouldn't be the end of the world - but the particular debug location that was ending up there was for the previous function's last instruction. This produced debug info for another function within this function, which is something I'm trying to remove all cases of as its a substantial source of bugs, especially around inlining (see r219215). llvm-svn: 219690
* Revert "Remove threshold on object size for inserting lifetime begin / end"Arnaud A. de Grandmaison2014-10-084-57/+2
| | | | | | Revert this patch while I investigate some sanitizer failures off-line. llvm-svn: 219307
* Remove threshold on object size for inserting lifetime begin / endArnaud A. de Grandmaison2014-10-084-2/+57
| | | | | | | | | Boostrapping LLVM+Clang+LLDB without threshold on object size for lifetime markers insertion has shown there was no significant change in compile time, so let the stack slot colorizer do its optimization for all slots. llvm-svn: 219303
* Fix an assertion failure trying to emit a trivial destructor in ObjC++Ben Langmuir2014-09-261-0/+50
| | | | | | | | | | | | | | | | | | If a base class declares a destructor, we will add the implicit destructor for the subclass in ActOnFields -> AddImplicitlyDeclaredMembersToClass But in Objective C++, we did not compute whether we have a trivial destructor until after that in CXXRecordDecl::completeDefinition() This was leading to a mismatch between the class, which thought it had no trivial destructor, and the CXXDestructorDecl, which considered itself trivial. It turns out the reason we delayed setting this until completeDefinition() was for a warning that has since been removed as part of -Warc-abi, so we just do it eagerly now. llvm-svn: 218520
* Objective-C ARC. Use of non-retain/autorelease APIFariborz Jahanian2014-08-082-3/+11
| | | | | | | for building Objective-C array literals in ARC mode. rdar://17554063 llvm-svn: 215232
* Objective-C ARC. More code for Objective-C'sFariborz Jahanian2014-08-061-2/+6
| | | | | | new APIs for literals. nfc. wip. rdar://17554063 llvm-svn: 215043
* CodeGenObjCXX: Add a test for r214699David Majnemer2014-08-051-0/+22
| | | | | | I forgot to add this with the changes for r214699. llvm-svn: 214829
* AST: Fix the mangling for unqualified-blocksDavid Majnemer2014-08-041-7/+6
| | | | | | | | | | | | | | | | CXXNameMangler::mangleUnqualifiedBlock believed that MangleContext::getBlockId returned something that used Itanium-style discriminator numbers. Discriminator numbers start their numberign from 1 and the first mangling that actually gets any sort of number mangled in is the second discriminator. However, Block IDs start from zero. The logic for omitting the mangling number did a ' > 1' instead of a ' > 0' comparison; this could potentially cause mangling conflicts. llvm-svn: 214699
* Mark C++ reference parameters as dereferenceableHal Finkel2014-07-1812-24/+24
| | | | | | | | | | | | | | Because references must be initialized using some evaluated expression, they must point to something, and a callee can assume the reference parameter is dereferenceable. Taking advantage of a new attribute just added to LLVM, mark them as such. Because dereferenceability in addrspace(0) implies nonnull in the backend, we don't need both attributes. However, we need to know the size of the object to use the dereferenceable attribute, so for incomplete types we still emit only nonnull. llvm-svn: 213386
* Improve robustness of tests for module flags metadataOliver Stannard2014-06-191-3/+3
| | | | | | | Fix clang tests to not break if the ID numbers of module flags metadata nodes change. llvm-svn: 211276
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-2812-26/+26
| | | | | | type in a function type where the C++ type is a reference. Update the tests. llvm-svn: 209723
* Include translation unit filename in global ctor symbol names.Nico Weber2014-05-061-1/+1
| | | | | | | | | | | | | | | | | This makes it easier to see where a global ctor comes from, and it also makes ASan's init order analyzer output easier to understand. gcc does this too, but only in -fPIC mode for some reason. Don't do this for constructors with explicit init priority. Also prepend "sub_" before the 'I', that way regular constructors stay lexicographically after symbols with init priority (because ord('s') > ord('I')). gold seems to ignore the name of constructor symbols, and ld only looks at the symbol if it includes an init priority, which this patch doesn't change. Before: __GLOBAL_I_a Now: __GLOBAL_sub_I_myfile.cc llvm-svn: 208128
* Objective-C++ IRGen. Due to change to AST for initialization of c++11’s Fariborz Jahanian2014-03-141-0/+32
| | | | | | | | data members by addition of CXXDefaultInitExpr node to the initializer expression, it has broken treatment of arc code for such initializations. Reviewed by John McCall. // rdar://16299964 llvm-svn: 203935
* Objective-C properties. Fixes a crash in Sema where RHS ofFariborz Jahanian2014-03-061-0/+53
| | | | | | | the property assignment is an lvalue for an incomplete type. // rdar://15118128. Reviewed offline by John McCall. llvm-svn: 203043
* Use private linkage for globals we already name with \01L and \01l.Rafael Espindola2014-02-274-5/+5
| | | | | | | | | | | | In llvm the only semantic difference between internal and private is that llvm tries to hide private globals my mangling them with a private prefix. Since the globals changed by this patch already had the magic don't mangle marker, there should be no change in the generated assembly. A followup patch should then be able to drop the \01L and \01l prefixes and let llvm mangle as appropriate. llvm-svn: 202419
* type_info objects are not unnamed_addr: the ABI requires us toJohn McCall2014-02-081-7/+7
| | | | | | | | | | unique them and permits the implementation of dynamic_cast (and anything else which knows it's working with a complete class type) to compare their addresses directly. rdar://16005328 llvm-svn: 201020
* [ms-cxxabi] Use inalloca on win32 when passing non-trivial C++ objectsReid Kleckner2014-02-011-3/+3
| | | | | | | | | | | | | | | | | | | When a non-trivial parameter is present, clang now gathers up all the parameters that lack inreg and puts them into a packed struct. MSVC always aligns each parameter to 4 bytes and no more, so this is a pretty simple struct to lay out. On win64, non-trivial records are passed indirectly. Prior to this change, clang was incorrectly using byval on win64. I'm able to self-host a working clang with this change and additional LLVM patches. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2636 llvm-svn: 200597
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-142-2/+2
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* Update tests in preparation for using the MS ABI for Win32 targetsHans Wennborg2014-01-131-1/+1
| | | | | | | | | | In preparation for making the Win32 triple imply MS ABI mode, make all tests pass in this mode, or make them use the Itanium mode explicitly. Differential Revision: http://llvm-reviews.chandlerc.com/D2401 llvm-svn: 199130
* Remove duplicated -cc1 in testsAlp Toker2013-12-081-2/+2
| | | | llvm-svn: 196728
* [ms-cxxabi] Construct and destroy call arguments in the correct orderReid Kleckner2013-12-041-0/+20
| | | | | | | | | | | | | | | | | | | Summary: MSVC destroys arguments in the callee from left to right. Because C++ objects have to be destroyed in the reverse order of construction, Clang has to construct arguments from right to left and destroy arguments from left to right. This patch fixes the ordering by reversing the order of evaluation of all call arguments under the MS C++ ABI. Fixes PR18035. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2275 llvm-svn: 196402
OpenPOWER on IntegriCloud