summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
Commit message (Collapse)AuthorAge
* Improve key-function computation for templates. In particular:Douglas Gregor2010-01-05
| | | | | | | | | | | | | | | | | | - All classes can have a key function; templates don't change that. non-template classes when computing the key function. - We always mark all of the virtual member functions of class template instantiations. - The vtable for an instantiation of a class template has weak linkage. We could probably use available_externally linkage for vtables of classes instantiated by explicit instantiation declarations (extern templates), but GCC doesn't do this and I'm not 100% that the ABI permits it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92753 91177308-0d34-0410-b5e6-96231b3b80d8
* Move address points to CGVtableInfo, no functionality change.Anders Carlsson2010-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92420 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly pass VTT parameters to constructors and destructors. The VTTs ↵Anders Carlsson2010-01-02
| | | | | | aren't yet used in the ctors/dtors, but that will follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92409 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a few more functions away from CGCXX and to CGClass and CGExprCXX.Anders Carlsson2010-01-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92399 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of bugs with VMI RTTI building, and add a whole bunch of tests.Anders Carlsson2009-12-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92319 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some dead code.Mike Stump2009-12-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92123 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that ↵Anders Carlsson2009-12-17
| | | | | | takes a CXXRecordDecl since we were just creating a QualType from it anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91590 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a small bug in ComputeMethodVtableIndices.Eli Friedman2009-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91411 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix linkage of type info and vtable for classes without linkage.Eli Friedman2009-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91152 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve linkage of RTTI data structures. Introduce ↵Anders Carlsson2009-12-11
| | | | | | CodeGenModule::GetAddrOfRTTI which figures out the right linkage of the RTTI information for the given type and whether it should be defined or not. I will migrate clients over to GetAddrOfRTTI in subsequent commits (with tests). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91098 91177308-0d34-0410-b5e6-96231b3b80d8
* Slight tweak to vtable linkage.Eli Friedman2009-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90832 91177308-0d34-0410-b5e6-96231b3b80d8
* A bunch more thunk fixes from misc testing.Eli Friedman2009-12-07
| | | | | | | | (Yes, I do intend to commit some tests for this.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90818 91177308-0d34-0410-b5e6-96231b3b80d8
* It's OK to try to emit a vtable definition more than once. Fixes PR5697.Anders Carlsson2009-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90751 91177308-0d34-0410-b5e6-96231b3b80d8
* Erm, revert for the moment; I didn't test this as thoroughly as I should haveEli Friedman2009-12-07
| | | | | | | | (although it does pass regression tests). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90747 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak the formula for non-virtual offsets to something which appears a bitEli Friedman2009-12-07
| | | | | | | | more accurate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90746 91177308-0d34-0410-b5e6-96231b3b80d8
* Move key functions to a separate map.Anders Carlsson2009-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90745 91177308-0d34-0410-b5e6-96231b3b80d8
* Be a bit more complete about accumulating SavedThisAdjustments.Eli Friedman2009-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90723 91177308-0d34-0410-b5e6-96231b3b80d8
* Work-in-progess rewrite of thunks: move thunk generation outside of vtableEli Friedman2009-12-06
| | | | | | | | | generation, and make sure we generate thunks when the function is defined rather than when the vtable is defined. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90722 91177308-0d34-0410-b5e6-96231b3b80d8
* Set the correct linkage for VTTs as well.Anders Carlsson2009-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90689 91177308-0d34-0410-b5e6-96231b3b80d8
* More linkage improvements.Anders Carlsson2009-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90687 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass the desired vtable linkage to GenerateVtable directly. Only call ↵Anders Carlsson2009-12-06
| | | | | | MaybeMarkVirtualImplicitMembersReferenced for non-inline functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90686 91177308-0d34-0410-b5e6-96231b3b80d8
* Make GenerateVtable a private member function of CGVtableInfo.Anders Carlsson2009-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90684 91177308-0d34-0410-b5e6-96231b3b80d8
* Only emit the vtable definition if the class has a key function and we're ↵Anders Carlsson2009-12-05
| | | | | | emitting it, or if the class doesn't have a key function and we are emitting the complete constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90681 91177308-0d34-0410-b5e6-96231b3b80d8
* If a class does not have a key function, its linkage should be weak_odr.Anders Carlsson2009-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90680 91177308-0d34-0410-b5e6-96231b3b80d8
* Use createGlobalVariable for creating vtable variables too.Anders Carlsson2009-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90679 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGenModule::GenerateVtable now returns a pointer directly to the vtable ↵Anders Carlsson2009-12-05
| | | | | | and not to the address point. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90676 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that hte vtable always has an i8* array type.Anders Carlsson2009-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90675 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a function for getting the vtable address point of a class.Anders Carlsson2009-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90674 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify BuildVTT.Anders Carlsson2009-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90673 91177308-0d34-0410-b5e6-96231b3b80d8
* Let the VTT builder pretend that getVtable returns a pointer to the vtable ↵Anders Carlsson2009-12-05
| | | | | | and not to the vtable address point. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90672 91177308-0d34-0410-b5e6-96231b3b80d8
* Change getCtorVtable to not return the address point offset, but the global ↵Anders Carlsson2009-12-05
| | | | | | variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90671 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor vtable related GlobalVariable creation out into a separate function. ↵Anders Carlsson2009-12-05
| | | | | | Add vtable linkage test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90667 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip actually generating the vtable unless we are defining it. This avoidsEli Friedman2009-12-05
| | | | | | | | the side-effects of generating the methods in the vtable (including PR5676). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90635 91177308-0d34-0410-b5e6-96231b3b80d8
* Return bool as a bool instead of a uint64_t.Benjamin Kramer2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90610 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename 'Class' to 'MostDerivedClass'Anders Carlsson2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90573 91177308-0d34-0410-b5e6-96231b3b80d8
* Store the vtable components in a SmallVector.Anders Carlsson2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90571 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a different ConstantArray::get.Anders Carlsson2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90570 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the vtable vector directly into the Vtable builder.Anders Carlsson2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90569 91177308-0d34-0410-b5e6-96231b3b80d8
* Change getIndex to return false if the index wasn't found. Avoids an extra ↵Anders Carlsson2009-12-04
| | | | | | hash lookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90568 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanup; no functionality change.Eli Friedman2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90565 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused argument.Eli Friedman2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90563 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate submethods vector.Eli Friedman2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90562 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the inner loop in VtableBuilder::OverrideMethod.Eli Friedman2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90561 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that overridden method decls are always canonical.Anders Carlsson2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90542 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix regression in vtable improvements.Eli Friedman2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90540 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename method to something easier to search for.Eli Friedman2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90536 91177308-0d34-0410-b5e6-96231b3b80d8
* More work in preparation of getting rid of the submethods loop.Anders Carlsson2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90535 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused member variable.Anders Carlsson2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90534 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a way to get the index of a method. Assert that we have the same index ↵Anders Carlsson2009-12-04
| | | | | | for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90533 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a premature optimization.Anders Carlsson2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90532 91177308-0d34-0410-b5e6-96231b3b80d8