summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/pointers-to-data-members.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[CodeGenCXX] Treat 'this' as noalias in constructors"Sean Fertile2018-10-151-1/+1
| | | | | | | This reverts commit https://reviews.llvm.org/rL344150 which causes MachineOutliner related failures on the ppc64le multistage buildbot. llvm-svn: 344526
* [CodeGenCXX] Treat 'this' as noalias in constructorsAnton Bikineev2018-10-101-1/+1
| | | | | | | | | This is currently a clang extension and a resolution of the defect report in the C++ Standard. Differential Revision: https://reviews.llvm.org/D46441 llvm-svn: 344150
* Make some tests LLVM-optimization agnostic and remove some others that were ↵David Blaikie2015-11-141-38/+0
| | | | | | | | | | | | | | | | beyond value/repair Several of these tests (the two deleted, and the one removal edit) were relying on the optimizer to collapse things to test some frontend feature. The tests were really old and features seemed amply covered by other parts of the test suite, so I just removed them. If anyone thinks they're valuable enough to keep/fix, we can play around with that, for sure. (inspired by r252872) llvm-svn: 253114
* Update clang regression tests for 'norecurse'James Molloy2015-11-121-1/+1
| | | | | | FunctionAttrs has just been taught how to infer 'norecurse'. Update clang tests for LLVM r252871. llvm-svn: 252872
* [CodeGen] Indirect fields can initialize a unionDavid Majnemer2015-05-301-0/+10
| | | | | | | | The first named data member is the field used to default initialize the union. An IndirectFieldDecl can introduce the first named data member of a union. llvm-svn: 238649
* [CodeGen] Handle flexible array members containing pointers to membersDavid Majnemer2015-05-261-0/+8
| | | | | | | | | | Types can be classified as being zero-initializable or non-zero-initializable. We used to classify array types by giving them the classification of their base element type. However, incomplete array types are never initialized directly and thus are always zero-initializable. llvm-svn: 238256
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-2/+2
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-1/+1
| | | | llvm-svn: 230783
* CodeGen: Use the initing member's type for a union's storage type more oftenDavid Majnemer2014-10-151-0/+9
| | | | | | | | | | Unions are initialized with the default initialization of their first named member. If that member is not zero initialized, then we should prefer that member's type. Otherwise, we might try to make an otherwise unsuitable type (like an array) which we cannot easily initialize with a pointer to member. llvm-svn: 219781
* CodeGen: Don't crash when initializing pointer-to-member fields in basesDavid Majnemer2014-09-281-1/+14
| | | | | | | | | | | | | | | | | Clang uses two types to talk about a C++ class, the NonVirtualBaseLLVMType and the LLVMType. Previously, we would allow one of these to be packed and the other not. This is problematic. If both don't agree on a common subset of fields, then routines like getLLVMFieldNo will point to the wrong field. Solve this by copying the 'packed'-ness of the complete type to the non-virtual subobject. For this to work, we need to take into account the non-virtual subobject's size and alignment when we are computing the layout of the complete object. This fixes PR21089. llvm-svn: 218577
* Mark C++ reference parameters as dereferenceableHal Finkel2014-07-181-1/+1
| | | | | | | | | | | | | | 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
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-281-1/+1
| | | | | | type in a function type where the C++ type is a reference. Update the tests. llvm-svn: 209723
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-3/+3
| | | | | | tests fail. llvm-svn: 188447
* Add more of the command line options as attribute flags.Bill Wendling2013-02-281-3/+3
| | | | | | These can be easily queried by the back-end. llvm-svn: 176304
* Reapply r176133 with testcase fixes.Bill Wendling2013-02-271-6/+3
| | | | llvm-svn: 176145
* Revert "Add more attributes from the command line to functions."Anna Zaks2013-02-251-3/+6
| | | | | | | | 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-6/+3
| | | | | | | This is an ongoing process. Any command line option which a back-end cares about should be added here. llvm-svn: 176009
* Modify the tests to use attribute group references instead of listing theBill Wendling2013-02-201-2/+7
| | | | | | function attributes. llvm-svn: 175606
* Make the ".*" operator work correctly when the base is a prvalue and the ↵Eli Friedman2012-06-151-0/+14
| | | | | | field has a non-trivial copy constructor. PR13097. llvm-svn: 158578
* Make sure we correctly zero-initialize unions containing a pointer to data ↵Eli Friedman2011-12-071-0/+10
| | | | | | member as the first field. PR11487. llvm-svn: 146009
* fix an unintended behavior change in the type system rewrite, which caused ↵Chris Lattner2011-07-121-2/+2
| | | | | | | | | | | | | | | | | | | | | us to compile stuff like this: typedef struct { int x, y, z; } foo_t; foo_t g; into: %"struct.<anonymous>" = type { i32, i32, i32 } we now get: %struct.foo_t = type { i32, i32, i32 } This doesn't change the behavior of the compiler, but makes the IR much easier to read. llvm-svn: 134969
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-4/+4
| | | | llvm-svn: 134831
* When laying out bases in, always try the "base subobject" LLVM type. If itAnders Carlsson2011-04-171-5/+5
| | | | | | | | | | | | | turns out that a field or base needs to be laid out in the tail padding of the base, CGRecordLayoutBuilder::ResizeLastBaseFieldIfNecessary will convert it to an array of i8. I've audited the new test results to make sure that they are still valid. I've also verified that we pass a self-host with this change. This (finally) fixes PR5589! llvm-svn: 129673
* Perform zero-initialization of virtual base classes when emitting John McCall2011-02-151-15/+28
| | | | | | | | | | | | a zero constant for a complete class. rdar://problem/8424975 To make this happen, track the field indexes for virtual bases in the complete object. I'm curious whether we might be better off making CGRecordLayoutBuilder *much* more reliant on ASTRecordLayout; we're currently duplicating an awful lot of the ABI layout logic. llvm-svn: 125555
* Move unnamed_addr after the function arguments on Sabre's request.Rafael Espindola2011-01-251-1/+1
| | | | llvm-svn: 124210
* Add unnamed_addr to constructors and destructors.Rafael Espindola2011-01-111-1/+1
| | | | llvm-svn: 123197
* Don't try to evaluate the LHS or RHS of a member pointer binary operation. ↵Anders Carlsson2010-10-311-0/+11
| | | | | | Fixes PR8507. llvm-svn: 117850
* Substantially revise how clang computes the visibility of a declaration toJohn McCall2010-10-221-3/+6
| | | | | | | | more closely parallel the computation of linkage. This gets us to a state much closer to what gcc emits, modulo bugs, which will undoubtedly arise in abundance. llvm-svn: 117147
* Fix a crash involving pointer-to-data-members of boolean type. We wereDouglas Gregor2010-09-021-0/+14
| | | | | | | | | | | | constructing an LLVM PointerType directly from the "bool"'s LLVM type (i1), which resulted in unfortunate pointer type i1*. The fix is to build the LLVM PointerType from the corresponding Clang PointerType, so that we get i8* in the case of a bool. John, please review. I also left a FIXME there because we seem to be dropping "volatile", which would be rather unfortunate. llvm-svn: 112819
* Abstract out everything having to do with member pointers into the ABIJohn McCall2010-08-231-5/+11
| | | | | | | | | | | class; they should just be completely opaque throughout IR gen now, although I haven't really audited that. Fix a bug apparently inherited from gcc-4.2 where we failed to null-check member data pointers when performing derived-to-base or base-to-derived conversions on them. llvm-svn: 111789
* implement rdar://7432000 - signed negate should codegen as NSW.Chris Lattner2010-06-261-2/+2
| | | | | | While I'm in there, adjust pointer to member adjustments as well. llvm-svn: 106955
* Don't try to explicitly zero out bit-fields.Anders Carlsson2010-06-031-0/+11
| | | | llvm-svn: 105391
* When null-initializing bases with data member pointers, don't assert on ↵Anders Carlsson2010-05-271-0/+21
| | | | | | virtual bases. Just initialize them to null. llvm-svn: 104868
* Really fix PR7139. There was one boost test that we still failed, and my ↵Anders Carlsson2010-05-221-0/+6
| | | | | | first fix broke self-host. llvm-svn: 104447
* Re-land the fix for PR7139.Anders Carlsson2010-05-221-1/+28
| | | | llvm-svn: 104446
* Unbreak self-host.Anders Carlsson2010-05-211-28/+1
| | | | llvm-svn: 104390
* Rename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle ↵Anders Carlsson2010-05-211-1/+28
| | | | | | setting null data member pointers correctly. Fixes PR7139. llvm-svn: 104387
* Correctly initialize bases with member pointers. This should fix PR6441 but ↵Anders Carlsson2010-05-181-0/+16
| | | | | | that test case is a bit weird and I'd like to investigate further before closing that bug. llvm-svn: 104025
* Make sure that value-initialized pointers to data members are initialized ↵Anders Carlsson2010-05-141-0/+17
| | | | | | correctly. llvm-svn: 103771
* Fix a test case.Anders Carlsson2010-02-051-1/+2
| | | | llvm-svn: 95374
* Improve handling of emitting 'null' pointers to data members.Anders Carlsson2010-02-021-0/+17
| | | | llvm-svn: 95066
* Move pointer to data member emission to CodeGenModule and use it in ↵Anders Carlsson2010-02-021-17/+28
| | | | | | CGExprConstant. Fixes PR5674. llvm-svn: 95063
* Merge a test into pointers-to-data-members.cpp and convert it to FileCheck.Anders Carlsson2010-02-021-0/+32
| | | | llvm-svn: 95061
* Rename a test.Anders Carlsson2010-02-021-0/+26
llvm-svn: 95060
OpenPOWER on IntegriCloud