summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGClass.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Handle default arguments when calling copy constructors for bases or members ↵Anders Carlsson2010-03-301-0/+20
| | | | | | when synthesizing a copy constructor. Fixes PR6628. llvm-svn: 99864
* Flip the switch to always get vtables from the VTT when necessary, I've ↵Anders Carlsson2010-03-291-7/+3
| | | | | | verified that clang bootstraps with this. llvm-svn: 99800
* Cleanup, no functionality change.Anders Carlsson2010-03-291-6/+1
| | | | llvm-svn: 99798
* Fix another thinko, so that flags don't depend on previous bases.Anders Carlsson2010-03-291-5/+7
| | | | llvm-svn: 99791
* When generating base ctors/dtors, we need to lookup virtual bases using the ↵Anders Carlsson2010-03-291-4/+15
| | | | | | vtable. llvm-svn: 99790
* Use construction vtables when needed. This is currently guarded by ↵Anders Carlsson2010-03-291-5/+29
| | | | | | -fdump-vtable-layouts since it doesn't work 100% yet :) llvm-svn: 99787
* Reapply r99775 with a fix for a silly bug - we were setting the vtable ↵Anders Carlsson2010-03-281-47/+58
| | | | | | pointer for all bases, even those without a vtable pointer :) llvm-svn: 99777
* Looks like I broke self-host again :(.Anders Carlsson2010-03-281-53/+46
| | | | llvm-svn: 99776
* More improvements to setting the vtable pointer. We now no longer set the ↵Anders Carlsson2010-03-281-46/+53
| | | | | | vtable pointer for non-virtual primary bases. We also do a pre-order traversal of the class hierarchy; this is necessary in order to get the right vbase offset offsets in base ctors/dtors. llvm-svn: 99775
* Factor vtable pointer setting code out into a separate function.Anders Carlsson2010-03-281-21/+32
| | | | llvm-svn: 99773
* Revert r99612 and see if it fixes self-host.Anders Carlsson2010-03-261-7/+0
| | | | llvm-svn: 99614
* Don't initialize virtual pointers for primary bases, they've already been ↵Anders Carlsson2010-03-261-0/+7
| | | | | | initialized. llvm-svn: 99612
* Simplify InitializeVtablePtrs in preparation of making it work with ↵Anders Carlsson2010-03-261-52/+57
| | | | | | construction vtables. llvm-svn: 99609
* Use getNamedGlobal instead of getGlobalVariable. (Fixes self-host).Anders Carlsson2010-03-241-1/+1
| | | | llvm-svn: 99385
* More vtable work; preparations for moving over to the new vtable layout code ↵Anders Carlsson2010-03-241-5/+7
| | | | | | (finally). llvm-svn: 99381
* Rename CGVtableInfo to CodeGenVTables in preparation of adding another ↵Anders Carlsson2010-03-231-14/+14
| | | | | | VTableInfo class. llvm-svn: 99250
* Rename getVirtualBaseOffsetIndex to getVirtualBaseOffsetOffset to reflect ↵Anders Carlsson2010-03-111-4/+4
| | | | | | what it actually does. llvm-svn: 98248
* Perform two more constructor/destructor code-size optimizations:John McCall2010-02-231-11/+125
| | | | | | | | | | | | | | | | 1) emit base destructors as aliases to their unique base class destructors under some careful conditions. This is enabled for the same targets that can support complete-to-base aliases, i.e. not darwin. 2) Emit non-variadic complete constructors for classes with no virtual bases as calls to the base constructor. This is enabled on all targets and in theory can trigger in situations that the alias optimization can't (mostly involving virtual bases, mostly not yet supported). These are bundled together because I didn't think it worthwhile to split them, not because they really need to be. llvm-svn: 96842
* More refactoring around constructor/destructor code generation.John McCall2010-02-191-48/+129
| | | | | | | | | | | | Fix some bugs with function-try-blocks and simplify normal try-block code generation. This implementation excludes a deleting destructor's call to operator delete() from the function-try-block, which I believe is correct but which I can't find straightforward support for at a moment's glance. llvm-svn: 96670
* Make deleting and complete dtor variants defer to other dtor variants byJohn McCall2010-02-181-36/+51
| | | | | | | | calling them as subroutines. This triggers whenever the alias optimization doesn't, i.e. when the dtor has linkonce linkage or there are virtual bases or it's the deleting dtor. llvm-svn: 96605
* Extract out function-body code generation into its own method. No functionalityJohn McCall2010-02-181-31/+38
| | | | | | change. llvm-svn: 96564
* IRgen optimization: cache the value of 'this' and 'vtt' instead ofJohn McCall2010-02-161-8/+0
| | | | | | | | repeatedly reloading from an alloca. We still need to create the alloca for debug info purposes (although we currently create it in all cases because of some abstraction boundaries that're hard to break down). llvm-svn: 96403
* When emitting complete destructors for classes with virtual bases, computeJohn McCall2010-02-161-34/+54
| | | | | | | | | | | | the offset to the virtual bases statically inside of relying on the virtual base offsets in the object's vtable(s). This is both more efficient and sound against the destructor's manipulation of the vtables. Also extract a few helper routines. Oh and we seem to pass all tests with an optimized clang now. llvm-svn: 96327
* Make sure to set vtable pointers in the destructors as well.Anders Carlsson2010-02-071-1/+1
| | | | llvm-svn: 95525
* Call destructors for constructed bases as well.Anders Carlsson2010-02-061-0/+13
| | | | llvm-svn: 95502
* If a constructor throws an exception we need to execute the destructors for ↵Anders Carlsson2010-02-061-0/+19
| | | | | | all fully constructed members. Fixes ctor_dtor_count.cpp in the test suite. llvm-svn: 95501
* Remove unused variable.Ted Kremenek2010-02-061-1/+0
| | | | llvm-svn: 95476
* Rearrange some checks to avoid call to isCopyConstructor() and clarify pathJohn McCall2010-02-061-12/+14
| | | | | | taken for non-trivial constructors. llvm-svn: 95457
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-051-12/+10
| | | | | | | | | | | | follows (as conservatively as possible) gcc's current behavior: attributes written on return types that don't apply there are applied to the function instead, etc. Only parse CC attributes as type attributes, not as decl attributes; don't accepet noreturn as a decl attribute on ValueDecls, either (it still needs to apply to other decls, like blocks). Consistently consume CC/noreturn information throughout codegen; enforce this by removing their default values in CodeGenTypes::getFunctionInfo(). llvm-svn: 95436
* Revert the new reference binding code; I came up with a way simpler solution ↵Anders Carlsson2010-02-031-1/+1
| | | | | | for the reference binding bug that is preventing self-hosting. llvm-svn: 95223
* Set the correct vtable pointers _before_ generating code for any member ↵Anders Carlsson2010-02-021-5/+10
| | | | | | initializers. Fixes about ~2000 clang/LLVM tests in the clang-on-clang build. llvm-svn: 95116
* Simplify EmitMemberInitializer; no intended functionality change.Eli Friedman2010-01-311-19/+1
| | | | llvm-svn: 94965
* Rework base and member initialization in constructors, with severalDouglas Gregor2010-01-311-40/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (necessarily simultaneous) changes: - CXXBaseOrMemberInitializer now contains only a single initializer rather than a set of initialiation arguments + a constructor. The single initializer covers all aspects of initialization, including constructor calls as necessary but also cleanup of temporaries created by the initializer (which we never handled before!). - Rework + simplify code generation for CXXBaseOrMemberInitializers, since we can now just emit the initializer as an initializer. - Switched base and member initialization over to the new initialization code (InitializationSequence), so that it - Improved diagnostics for the new initialization code when initializing bases and members, to match the diagnostics produced by the previous (special-purpose) code. - Simplify the representation of type-checked constructor initializers in templates; instead of keeping the fully-type-checked AST, which is rather hard to undo at template instantiation time, throw away the type-checked AST and store the raw expressions in the AST. This simplifies instantiation, but loses a little but of information in the AST. - When type-checking implicit base or member initializers within a dependent context, don't add the generated initializers into the AST, because they'll look like they were explicit. - Record in CXXConstructExpr when the constructor call is to initialize a base class, so that CodeGen does not have to infer it from context. This ensures that we call the right kind of constructor. There are also a few "opportunity" fixes here that were needed to not regress, for example: - Diagnose default-initialization of a const-qualified class that does not have a user-declared default constructor. We had this diagnostic specifically for bases and members, but missed it for variables. That's fixed now. - When defining the implicit constructors, destructor, and copy-assignment operator, set the CurContext to that constructor when we're defining the body. llvm-svn: 94952
* When performing a derived-to-base cast that we know will not change the ↵Anders Carlsson2010-01-311-52/+49
| | | | | | offset, we don't need to null check the input pointer. Fixes PR5965. llvm-svn: 94942
* When doing a base-to-derived cast we don't need to null check the derived ↵Anders Carlsson2010-01-311-10/+15
| | | | | | value if the class offset is 0. llvm-svn: 94939
* Some class related cleanup.Anders Carlsson2010-01-311-27/+25
| | | | llvm-svn: 94938
* Use EmitLValueForFieldInitialization when synthesizing the copy ctor as well.Anders Carlsson2010-01-291-19/+2
| | | | llvm-svn: 94800
* Add a new EmitLValueForFieldInitialization that will be used for ↵Anders Carlsson2010-01-291-11/+2
| | | | | | initializing fields (and reference type fields in particular). llvm-svn: 94799
* Simplify EmitLValueForField - we can get whether the field is part of a ↵Anders Carlsson2010-01-291-12/+10
| | | | | | union or not from the FieldDecl (through its DeclContext). llvm-svn: 94798
* Fix a couple bugs in copy assignment operator synthesis.Eli Friedman2010-01-151-12/+12
| | | | llvm-svn: 93546
* Move address points to CGVtableInfo, no functionality change.Anders Carlsson2010-01-021-3/+3
| | | | llvm-svn: 92420
* Correctly pass VTT parameters to constructors and destructors. The VTTs ↵Anders Carlsson2010-01-021-25/+58
| | | | | | aren't yet used in the ctors/dtors, but that will follow. llvm-svn: 92409
* Move a few more functions away from CGCXX and to CGClass and CGExprCXX.Anders Carlsson2010-01-011-0/+351
| | | | llvm-svn: 92399
* Move a bunch of class related functions to CGClass.cpp, no functionality change.Anders Carlsson2009-12-241-0/+775
| | | | llvm-svn: 92148
* Add CodeGenModule::ComputeThunkAdjustment, which Eli wrote.Anders Carlsson2009-12-031-0/+36
| | | | llvm-svn: 90401
* Tests now pass with the assertion.Eli Friedman2009-11-281-3/+0
| | | | llvm-svn: 90026
* Add a much more thorough test of casts to virtual bases, and fixEli Friedman2009-11-281-14/+13
| | | | | | GetCXXBaseClassOffset to actually pass the test. llvm-svn: 90025
* Get rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and ↵Anders Carlsson2009-11-241-0/+239
CGTemporaries. llvm-svn: 89742
OpenPOWER on IntegriCloud