summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprAgg.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* When performing value-initialization for a class with a non-trivial,Douglas Gregor2010-08-221-4/+0
| | | | | | | | | | | | implicitly-defined default constructor, zero-initialize the memory before calling the default constructor. Previously, we would only zero-initialize in the case of a trivial default constructor. Also, simplify the hideous logic that determines when we have a trivial default constructor and, therefore, don't need to emit any call at all. llvm-svn: 111779
* Experiment with using first-class aggregates to represent member functionJohn McCall2010-08-221-55/+0
| | | | | | | | | | pointers. I find the resulting code to be substantially cleaner, and it makes it very easy to use the same APIs for data member pointers (which I have conscientiously avoided here), and it avoids a plethora of potential inefficiencies due to excessive memory copying, but we'll have to see if it actually works. llvm-svn: 111776
* Abstract out member-pointer creation. I'm really unhappy about the currentJohn McCall2010-08-221-16/+4
| | | | | | | | duplication between the constant and non-constant paths in all of this. Implement ARM ABI semantics for member pointer constants and conversion. llvm-svn: 111772
* Abstract more member-pointerness out.John McCall2010-08-221-11/+5
| | | | llvm-svn: 111771
* Abstract out member-pointer conversions.John McCall2010-08-221-33/+9
| | | | | | Pretty much everything having to do with member pointers is ABI-specific. llvm-svn: 111770
* IRgen/LValue: Add LValue::setNonGC instead of SetObjCNonGC, for consistency ↵Daniel Dunbar2010-08-211-1/+1
| | | | | | with isNonGC(). llvm-svn: 111718
* IRgen: Switch more MakeAddr() users to MakeAddrLValue; this time for calls ↵Daniel Dunbar2010-08-211-18/+15
| | | | | | which were previously not computing the qualifier list. In most cases, I don't think it matters, but I believe this is conservatively more correct / consistent. llvm-svn: 111717
* IRgen: Switch a bunch of trivial MakeAddr calls to use MakeAddrLValue.Daniel Dunbar2010-08-211-6/+4
| | | | llvm-svn: 111716
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-1/+3
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Introduce a new cast kind for an "lvalue bitcast", which handlesDouglas Gregor2010-07-131-0/+4
| | | | | | | | | | | | | | | | reinterpret_casts (possibly indirectly via C-style/functional casts) on values, e.g., int i; reinterpret_cast<short&>(i); The IR generated for this is essentially the same as for *reinterpret_cast<short*>(&i). Fixes PR6437, PR7593, and PR7344. llvm-svn: 108294
* Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor2010-07-081-2/+2
| | | | | | suppressing copies of objects with trivial copy constructors. llvm-svn: 107857
* fix the clang side of PR7437: EmitAggregateCopyChris Lattner2010-07-081-15/+8
| | | | | | | | | | | was not producing a memcpy with the right address spaces because of two places in it doing casts of the arguments to i8, one of which that didn't preserve the address space. There is also an optimizer bug here. llvm-svn: 107842
* Revert r107828 and r107827, the fix for PR7556, which seems to beDouglas Gregor2010-07-071-2/+2
| | | | | | breaking bootstrap on Linux. llvm-svn: 107837
* Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor2010-07-071-2/+2
| | | | | | newly-narrowed scope. No functionality change. llvm-svn: 107828
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | self-host. Hopefully these results hold up on different platforms. I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request. Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with. Document a lot of previously poorly-understood (by me, at least) behavior. The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR. llvm-svn: 107631
* misc tidyingChris Lattner2010-06-271-3/+1
| | | | llvm-svn: 106978
* finally get around to doing a significant cleanup to irgen:Chris Lattner2010-06-271-6/+3
| | | | | | | | have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMContextification and cleans up stuff a lot. llvm-svn: 106977
* Change EmitReferenceBindingToExpr to take a decl instead of a boolean.Anders Carlsson2010-06-261-1/+1
| | | | llvm-svn: 106949
* Patch adds support for copying of thoseFariborz Jahanian2010-06-151-5/+39
| | | | | | | | objective-c++ class objects which have GC'able objc object pointers and need to use ObjC's objc_memmove_collectable API (radar 8070772). llvm-svn: 106061
* Fix for PR7040: Don't try to compute the LLVM type for a function where itEli Friedman2010-05-301-25/+1
| | | | | | | | | | | isn't possible to compute. This patch is mostly refactoring; the key change is the addition of the code starting with the comment, "Check whether the function has a computable LLVM signature." The solution here is essentially the same as the way the vtable code handles such functions. llvm-svn: 105151
* Re-teach IR gen to perform GC moves on rvalues resulting from various ObjCJohn McCall2010-05-221-17/+54
| | | | | | | expressions. Essentially, GC breaks a certain form of the return-value optimization. llvm-svn: 104454
* Re-land the fix for PR7139.Anders Carlsson2010-05-221-5/+1
| | | | llvm-svn: 104446
* Improve our handling of reference binding for subobjects ofDouglas Gregor2010-05-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | temporaries. There are actually several interrelated fixes here: - When converting an object to a base class, it's only an lvalue cast when the original object was an lvalue and we aren't casting pointer-to-derived to pointer-to-base. Previously, we were misclassifying derived-to-base casts of class rvalues as lvalues, causing various oddities (including problems with reference binding not extending the lifetimes of some temporaries). - Teach the code for emitting a reference binding how to look through no-op casts and parentheses directly, since Expr::IgnoreParenNoOpCasts is just plain wrong for this. Also, make sure that we properly look through multiple levels of indirection from the temporary object, but destroy the actual temporary object; this fixes the reference-binding issue mentioned above. - Teach Objective-C message sends to bind the result as a temporary when needed. This is actually John's change, but it triggered the reference-binding problem above, so it's included here. Now John can actually test his return-slot improvements. llvm-svn: 104434
* Push a return-value slot throughout ObjC message-send codegen. Will beJohn McCall2010-05-221-7/+8
| | | | | | | critical for ObjC++ correctness; hard to test independently of various required Sema changes, though. llvm-svn: 104422
* Unbreak self-host.Anders Carlsson2010-05-211-1/+5
| | | | llvm-svn: 104390
* Rename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle ↵Anders Carlsson2010-05-211-5/+1
| | | | | | setting null data member pointers correctly. Fixes PR7139. llvm-svn: 104387
* Copy construction of non-trivial properties must notFariborz Jahanian2010-05-201-2/+1
| | | | | | be turned into a setter call (fixes radar 8008649). llvm-svn: 104235
* Picky, pickyDouglas Gregor2010-05-201-1/+1
| | | | llvm-svn: 104230
* Fix a thinkoDouglas Gregor2010-05-201-1/+1
| | | | llvm-svn: 104229
* Assert that we do not try to memcpy a non-POD class type in C++. ThisDouglas Gregor2010-05-201-1/+7
| | | | | | | | | | | | | | particular issue was the cause of the Boost.Interprocess failures, and in general will lead to horrendous, hard-to-diagnose miscompiles. The assertion itself has survives self-host and a full Boost build, so we are close to eradicating this problem in C++. Note that the assertion is *not* turned on for Objective-C++, where we still have problems with introducing memcpy's of non-POD class types. That part of the assertion will go away as soon as we fix the known issues in Objective-C++. llvm-svn: 104227
* Emit an lvalue dynamic_cast even if the result is not used. AnotherDouglas Gregor2010-05-141-1/+15
| | | | | | part (or possibly all) of PR7132. llvm-svn: 103810
* Remove an unused function.Anders Carlsson2010-05-141-6/+0
| | | | llvm-svn: 103793
* If we're generating code to create a pointer-to-member functionDouglas Gregor2010-05-031-0/+6
| | | | | | | aggregate and the result of the aggregate is unused, bail out early. Fixes PR7027. llvm-svn: 102942
* When computing the address of a virtual member function pointer, use the ↵Anders Carlsson2010-05-031-1/+6
| | | | | | pointer width instead of hardcoding for 64-bit. llvm-svn: 102921
* Don't copy or initialize empty classes. Fixes PR7012.Anders Carlsson2010-05-031-0/+8
| | | | llvm-svn: 102891
* Get rid of the old GetNonVirtualBaseClassOffset and change all call sites to ↵Anders Carlsson2010-04-241-1/+1
| | | | | | use the new version. llvm-svn: 102274
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-171-1/+1
| | | | llvm-svn: 101666
* Reapply patch for adding support for address spaces and added a isVolatile ↵Mon P Wang2010-04-041-4/+19
| | | | | | field to memcpy, memmove, and memset. llvm-svn: 100305
* Revert r100193 since it causes failures in objc in clangMon P Wang2010-04-021-19/+4
| | | | llvm-svn: 100200
* Reapply patch for adding support for address spaces and added a isVolatile ↵Mon P Wang2010-04-021-4/+19
| | | | | | field to memcpy, memmove, and memset. llvm-svn: 100193
* Revert Mon Ping's 99930 due to broken llvm-gcc buildbots.Bob Wilson2010-03-301-19/+4
| | | | llvm-svn: 99949
* Added support for address spaces and added a isVolatile field to memcpy, ↵Mon P Wang2010-03-301-4/+19
| | | | | | memmove, and memset llvm-svn: 99930
* Rename CGVtableInfo to CodeGenVTables in preparation of adding another ↵Anders Carlsson2010-03-231-2/+1
| | | | | | VTableInfo class. llvm-svn: 99250
* Fix PR6648 by not creating a temporary with the type of aRafael Espindola2010-03-211-4/+0
| | | | | | | | | | | CXXExprWithTemporaries. Not emitting the expression as an aggregate might be the right thing to do, but is orthogonal. Emitting it as an scalar expression will still try to create a temporary for the incomplete type of the CXXExprWithTemporaries and fail. llvm-svn: 99134
* add a codegen hack to work around an AST bug, allowing us to compile theChris Lattner2010-03-081-2/+12
| | | | | | code in PR6537. This should be reverted when the ast bug is fixed. llvm-svn: 97981
* Perform overload resolution when static_cast'ing from aDouglas Gregor2010-03-071-0/+10
| | | | | | | pointer-to-member-to-derived to a pointer-to-member-to-base. Fixes PR6072. llvm-svn: 97923
* PR6386: Fix a recent regression in IRGen of cast-to-union constructs.Eli Friedman2010-02-231-1/+1
| | | | llvm-svn: 96958
* IRgen: Add CreateMemTemp, for creating an temporary memory object for a ↵Daniel Dunbar2010-02-091-11/+10
| | | | | | | | | | particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing. - This fixes many many more places than the test case, but my feeling is we need to audit alignment systematically so I'm not inclined to try hard to test the individual fixes in this patch. If this bothers you, patches welcome! PR6240. llvm-svn: 95648
* Use the right type when taking the address of a non-virtual member function ↵Anders Carlsson2010-02-071-2/+6
| | | | | | pointer. Fixes PR6258. llvm-svn: 95524
* IRgen: Factor out EmitAggExprToLValue.Daniel Dunbar2010-02-051-0/+10
| | | | llvm-svn: 95416
OpenPOWER on IntegriCloud