summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGVTables.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Better solution: calculate the visibility of functions and variablesJohn McCall2010-10-301-2/+2
| | | | | | | | | | independently of whether they're definitions, then teach IR generation to ignore non-explicit visibility when emitting declarations. Use this to make sure that RTTI, vtables, and VTTs get the right visibility. More of rdar://problem/8613093 llvm-svn: 117781
* Make sure the VTables for template instantiations are emitted even if the ↵Argyrios Kyrtzidis2010-10-111-3/+22
| | | | | | key function doesn't have a body. llvm-svn: 116186
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-20/+16
| | | | | | under the ARM ABI. llvm-svn: 112588
* Just disable the hidden-visibility optimization for now by hiding it behindJohn McCall2010-08-121-1/+4
| | | | | | | | a -cc1 option. The Darwin linker complains about mixed visibility when linking gcc-built objects with clang-built objects, and the optimization isn't really that valuable. Platforms with less ornery linkers can feel free to enable this. llvm-svn: 110979
* It turns out that linkers (at least, the Darwin linker) don't necessarilyJohn McCall2010-08-051-10/+6
| | | | | | | | | | | do the right thing with mixed-visibility symbols, so disable the visibility optimization where that's possible, i.e. with template classes (since it's possible that an arbitrary template might be subject to an explicit instantiation elsewhere). 447.dealII actually does this. I've put the code under an option that's currently not hooked up to anything. llvm-svn: 110374
* Extend the visibility-hidden optimization to linkonce_odr thunks forJohn McCall2010-08-041-1/+51
| | | | | | | | | functions with in-line definitions, since such thunks will be emitted at any use of the function. Completes the feature work for rdar://problem/7523229. llvm-svn: 110285
* Emit standard-library RTTI with external linkage, not weak_odr.John McCall2010-08-041-33/+1
| | | | | | | | | | Apply hidden visibility to most RTTI; libstdc++ does not rely on exact pointer equality for the type info (just the type info names). Apply the same optimization to RTTI that we do to vtables. Fixes PR5962. llvm-svn: 110192
* Extend the hidden-visibility vtables optimization to template classes thatJohn McCall2010-08-041-10/+26
| | | | | | haven't been explicitly instantiated. llvm-svn: 110189
* Emit weak vtables of non-template classes with hidden visibility.John McCall2010-08-031-0/+16
| | | | llvm-svn: 110107
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-3/+0
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Make sure to set the visible on a vtable; VTTs and typeinfo alreadyDouglas Gregor2010-06-141-0/+3
| | | | | | handle visibility properly. Fixes <rdar://problem/8091955>. llvm-svn: 105977
* Remove now unused code.Anders Carlsson2010-06-041-235/+13
| | | | llvm-svn: 105448
* Use CXXRecordDecl::getFinalOverriders to get final overriders. This speeds ↵Anders Carlsson2010-06-041-1/+119
| | | | | | up vtable layout by moving away from the old final overrider computation code that had O(N^2) complexity in some cases. llvm-svn: 105447
* Don't try to emit the vtable for a class just because we're emitting aJohn McCall2010-06-021-12/+18
| | | | | | | | virtual function from it. Fixes PR7241. llvm-svn: 105345
* More cleanup.Anders Carlsson2010-06-011-14/+10
| | | | llvm-svn: 105301
* More cleanup.Anders Carlsson2010-06-011-35/+10
| | | | llvm-svn: 105299
* Cleanup.Anders Carlsson2010-06-011-8/+9
| | | | llvm-svn: 105296
* Remove unused parameter to FinalOverriders::PropagateOverrider.Anders Carlsson2010-05-301-5/+3
| | | | llvm-svn: 105171
* Correctly pass aggregates by reference when emitting thunks.John McCall2010-05-261-8/+1
| | | | llvm-svn: 104778
* If a function definition has any sort of weak linkage, its static localJohn McCall2010-05-251-1/+1
| | | | | | | | | | | | variables should have that linkage. Otherwise, its static local variables should have internal linkage. To avoid computing this excessively, set a function's linkage before we emit code for it. Previously we were assigning weak linkage to the static variables of static inline functions in C++, with predictably terrible results. This fixes that and also gives better linkage than 'weak' when merging is required. llvm-svn: 104581
* When generating the call arguments in a thunk to call the thunkee, doDouglas Gregor2010-05-211-3/+9
| | | | | | | | not make copies non-POD arguments or arguments passed by reference: just copy the pointers directly. This eliminates another source of the dreaded memcpy-of-non-PODs. Fixes PR7188. llvm-svn: 104327
* When creating a this-adjustment thunk where the return value is of C++Douglas Gregor2010-05-201-2/+9
| | | | | | | | | class type (that uses a return slot), pass the return slot to the callee directly rather than allocating new storage and trying to copy the object. This appears to have been the cause of the remaining two Boost.Interprocess failures. llvm-svn: 104215
* Rework when and how vtables are emitted, by tracking where vtables areDouglas Gregor2010-05-131-47/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "used" (e.g., we will refer to the vtable in the generated code) and when they are defined (i.e., because we've seen the key function definition). Previously, we were effectively tracking "potential definitions" rather than uses, so we were a bit too eager about emitting vtables for classes without key functions. The new scheme: - For every use of a vtable, Sema calls MarkVTableUsed() to indicate the use. For example, this occurs when calling a virtual member function of the class, defining a constructor of that class type, dynamic_cast'ing from that type to a derived class, casting to/through a virtual base class, etc. - For every definition of a vtable, Sema calls MarkVTableUsed() to indicate the definition. This happens at the end of the translation unit for classes whose key function has been defined (so we can delay computation of the key function; see PR6564), and will also occur with explicit template instantiation definitions. - For every vtable defined/used, we mark all of the virtual member functions of that vtable as defined/used, unless we know that the key function is in another translation unit. This instantiates virtual member functions when needed. - At the end of the translation unit, Sema tells CodeGen (via the ASTConsumer) which vtables must be defined (CodeGen will define them) and which may be used (for which CodeGen will define the vtables lazily). From a language perspective, both the old and the new schemes are permissible: we're allowed to instantiate virtual member functions whenever we want per the standard. However, all other C++ compilers were more lazy than we were, and our eagerness was both a performance issue (we instantiated too much) and a portability problem (we broke Boost test cases, which now pass). Notes: (1) There's a ton of churn in the tests, because the order in which vtables get emitted to IR has changed. I've tried to isolate some of the larger tests from these issues. (2) Some diagnostics related to implicitly-instantiated/implicitly-defined virtual member functions have moved to the point of first use/definition. It's better this way. (3) I could use a review of the places where we MarkVTableUsed, to see if I missed any place where the language effectively requires a vtable. Fixes PR7114 and PR6564. llvm-svn: 103718
* Fix typo in comment; 80 col violationDouglas Gregor2010-05-061-3/+3
| | | | llvm-svn: 103204
* Pass the globaldecl into GetOrCreateLLVMFunction so that llvmChris Lattner2010-05-051-1/+1
| | | | | | | | | function attributes like byval get applied to the function definition. This fixes PR7058 and makes i386 llvm/clang bootstrap pass all the same tests as x86-64 bootstrap for me (the llvmc tests still fail in both). llvm-svn: 103131
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-171-31/+31
| | | | llvm-svn: 101666
* Fix a bug where we would sometimes incorrectly mark an vtable function as ↵Anders Carlsson2010-04-171-6/+3
| | | | | | unused. llvm-svn: 101643
* Fix another bug where we wouldn't generate secondary vtables for ↵Anders Carlsson2010-04-111-5/+9
| | | | | | construction vtables in some cases. llvm-svn: 100998
* More renames.Anders Carlsson2010-04-111-46/+46
| | | | llvm-svn: 100991
* Rename a function parameter.Anders Carlsson2010-04-111-6/+10
| | | | llvm-svn: 100990
* Fix a bug where we were adding too many vcall offsets in some cases.Anders Carlsson2010-04-111-20/+7
| | | | llvm-svn: 100985
* Enable an assert and remove a now unnecessary assert.Anders Carlsson2010-04-101-12/+0
| | | | llvm-svn: 100953
* Fix a bug where we would add the same function twice in a vtable.Anders Carlsson2010-04-101-18/+20
| | | | llvm-svn: 100949
* Rename VtableComponent and VtableBuilder.Anders Carlsson2010-04-101-90/+90
| | | | llvm-svn: 100945
* Rename CGVtable files to CGVTables.Anders Carlsson2010-04-081-0/+3185
llvm-svn: 100778
OpenPOWER on IntegriCloud