summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/VTableBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix typo.Nico Weber2014-11-291-1/+1
| | | | llvm-svn: 222964
* Update for LLVM API change to make Small(Ptr)Set::insert return ↵David Blaikie2014-11-191-8/+9
| | | | | | pair<iterator, bool> as per the C++ standard's associative container concept. llvm-svn: 222335
* Minor readability tweaks to VFTableBuilder.cppTimur Iskhodzhanov2014-11-171-12/+14
| | | | llvm-svn: 222140
* Add a couple more examples illustrating why we need vtordisps and how they workTimur Iskhodzhanov2014-11-171-1/+98
| | | | llvm-svn: 222133
* Replace weird whitespace symbols with good old spacesTimur Iskhodzhanov2014-11-141-4/+4
| | | | llvm-svn: 221997
* Add one illustrative class hierarchy as an example in a comment to the ↵Timur Iskhodzhanov2014-11-141-0/+58
| | | | | | VFTableBuilder code llvm-svn: 221996
* Reduce double set lookups. NFC.Benjamin Kramer2014-10-101-2/+1
| | | | llvm-svn: 219504
* MS ABI: Assert that vftables should have a non-RTTI entryDavid Majnemer2014-09-261-1/+2
| | | | | | No functional change intended. llvm-svn: 218506
* Fix a vftable mangling bugReid Kleckner2014-09-221-13/+56
| | | | | | | | | | | | | We need to walk the class hierarchy twice: once in depth-first base specifier order for mangling and again in depth-first layout order for vftable layout. Vftable layout seems to depend on the full path from the most derived class to the base containing the vfptr. Fixes PR21031. llvm-svn: 218285
* MS ABI: Remove a FIXME that has been fixedDavid Majnemer2014-09-221-4/+3
| | | | | | We've implemented MSVC-style RTTI for quite some time. llvm-svn: 218269
* MS ABI: The latest VC "14" CTP implements deleted virtual functionsDavid Majnemer2014-09-121-10/+1
| | | | | | | | | | | | Deleted virtual functions get _purecall inserted into the vftable. Earlier CTPs would simply stick nullptr in there. N.B. MSVC can't handle deleted virtual functions which require return adjusting thunks, they give an error that a deleted function couldn't be called inside of a compiler generated function. We get this correct by making the thunk have a __purecall entry as well. llvm-svn: 217654
* Fix some cases were ArrayRefs were being passed by reference.Craig Topper2014-08-271-1/+1
| | | | llvm-svn: 216527
* Fix PR20444 -- wrong number of vftable slots created when return adjustment ↵Timur Iskhodzhanov2014-08-101-30/+28
| | | | | | | | thunks are needed Reviewed at http://reviews.llvm.org/D4822 llvm-svn: 215312
* Fix PR20479 -- missing vftable slots in case of virtual inheritance vs ↵Timur Iskhodzhanov2014-08-091-2/+9
| | | | | | | | return adjusting thunks Reviewed at http://reviews.llvm.org/D4829 llvm-svn: 215285
* Driver: Handle /GR- in a compatible way with MSVCDavid Majnemer2014-07-011-1/+1
| | | | | | | | | | | | | | | | | There are slight differences between /GR- and -fno-rtti which made mapping one to the other inappropriate. -fno-rtti disables dynamic_cast, typeid, and does not emit RTTI related information for the v-table. /GR- does not generate complete object locators and thus will not reference them in vftables. However, constructs like dynamic_cast and typeid are permitted. This should bring our implementation of RTTI up to semantic parity with MSVC modulo bugs. llvm-svn: 212138
* AST: Small simplification in VTableBuilderDavid Majnemer2014-07-011-4/+8
| | | | | | | Stash whether or not we have an RTTI component away instead of recomputing it. llvm-svn: 212127
* MS ABI: Reference MSVC RTTI from the VFTableDavid Majnemer2014-07-011-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pointer for a class's RTTI data comes right before the VFTable but has no name. To be properly compatible with this, we do the following: * Create a single GlobalVariable which holds the contents of the VFTable _and_ the pointer to the RTTI data. * Create a GlobalAlias, with appropriate linkage/visibility, that points just after the RTTI data pointer. This ensures that the VFTable symbol will always refer to VFTable data. * Create a Comdat with a "Largest" SelectionKind and stick the private GlobalVariable in it. By transitivity, the GlobalAlias will be a member of the Comdat group. Using "Largest" ensures that foreign definitions without an RTTI data pointer will _not_ be chosen in the final linked image. Whether or not we emit RTTI data depends on several things: * The -fno-rtti flag implies that we should never not emit a pointer to RTTI data before the VFTable. * __declspec(dllimport) brings in the VFTable from a remote DLL. Use an available_externally GlobalVariable to provide a local definition of the VFTable. This means that we won't have any available_externally definitions of things like complete object locators. This is acceptable because they are never directly referenced. To my knowledge, this completes the implementation of MSVC RTTI code generation. Further semantic work should be done to properly support /GR-. llvm-svn: 212125
* Remove llvm:: from uses of ArrayRef.Craig Topper2014-06-281-3/+2
| | | | llvm-svn: 211987
* [C++11] Use 'nullptr'. AST edition.Craig Topper2014-05-121-18/+19
| | | | llvm-svn: 208517
* MicrosoftVTableContext: Don't leak VPtrInfos. Found by LSan, PR19522.Nico Weber2014-04-241-0/+2
| | | | llvm-svn: 207138
* Fix PR19487, PR19505 and PR19506 -- redundant vtordisp thunks when the final ↵Timur Iskhodzhanov2014-04-221-17/+13
| | | | | | | | overrider is present in both a vbase and nvbase Reviewed at http://reviews.llvm.org/D3449 llvm-svn: 206908
* MS ABI: Don't append to vbtables that we shouldn't extendReid Kleckner2014-04-171-9/+9
| | | | | | | This was probably a benign bug, since nobody would look at the vbtable slots that we were filling in. llvm-svn: 206508
* Follow-up to r206457 -- fix static adjustments for some subtle virtual ↵Timur Iskhodzhanov2014-04-171-27/+15
| | | | | | | | inheritance cases Reviewed at http://reviews.llvm.org/D3410 llvm-svn: 206504
* Fix PR19408 - Missing static this adjustment in a vtordisp thunkTimur Iskhodzhanov2014-04-171-10/+28
| | | | | | | | Also fix a few other vtordisp-related bugs. Reviewed at http://reviews.llvm.org/D3400 llvm-svn: 206457
* Slightly improve the readability of ↵Timur Iskhodzhanov2014-03-311-3/+3
| | | | | | MicrosoftVTableContext::computeVTablePaths(). No functionality changes. llvm-svn: 205178
* Make the 'for (auto ...)' names more readableTimur Iskhodzhanov2014-03-261-34/+35
| | | | llvm-svn: 204787
* Fix PR19066 - 0-sized vftable in the presence of virtual inheritanceTimur Iskhodzhanov2014-03-261-1/+10
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D3181 llvm-svn: 204786
* MS ABI: Mark direct virtual bases as visted when building vtable pathsReid Kleckner2014-03-251-0/+2
| | | | | | Fixes PR19240. In retrospect, this is a fairly obvious bug. :) llvm-svn: 204744
* Fix PR19172 - wrong this adjustment calculated for virtual destructor in a ↵Timur Iskhodzhanov2014-03-201-8/+14
| | | | | | | | class with complex inheritance Reviewed at http://llvm-reviews.chandlerc.com/D3128 llvm-svn: 204394
* Flust stdout after each vftable dumped to simplify debuggingTimur Iskhodzhanov2014-03-201-0/+4
| | | | llvm-svn: 204341
* [C++11] Replacing CXXRecordDecl iterators method_begin() and method_end() ↵Aaron Ballman2014-03-131-21/+6
| | | | | | with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203812
* [C++11] Replacing CXXRecordDecl iterators vbases_begin() and vbases_end() ↵Aaron Ballman2014-03-131-8/+4
| | | | | | with iterator_range vbases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203808
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-36/+26
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* [C++11] Convert sort predicates into lambdas.Benjamin Kramer2014-03-071-5/+4
| | | | | | No functionality change. llvm-svn: 203289
* Fix PR18967 -- Bad this adjustment for virtual methods in a diamond virtual ↵Timur Iskhodzhanov2014-03-071-91/+37
| | | | | | inheritance hierarchy llvm-svn: 203222
* Style fix: replace "1 entries" with "1 entry" in the vftable layout dumping codeTimur Iskhodzhanov2014-03-051-2/+4
| | | | llvm-svn: 202978
* First step towards fixing PR18967 - simplify the ComputeThisOffset interfaceTimur Iskhodzhanov2014-03-041-15/+11
| | | | llvm-svn: 202870
* [C++11] Simplify compare operators with std::tie.Benjamin Kramer2014-03-031-7/+2
| | | | | | No functionality change. llvm-svn: 202755
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-1/+1
| | | | llvm-svn: 202639
* [C++11] Replace verbose functors with succinct lambdasBenjamin Kramer2014-03-011-45/+20
| | | | | | No functionality change. llvm-svn: 202590
* Fix leak in MicrosoftVTableContextReid Kleckner2014-02-281-0/+1
| | | | llvm-svn: 202558
* MS ABI: Attempt to fix DenseMap entry reference invalidationReid Kleckner2014-02-271-4/+5
| | | | llvm-svn: 202441
* MS ABI: Fix vftable mangling by using the vbtable name algorithmReid Kleckner2014-02-271-162/+60
| | | | | | | | | | | | | | | | | | Summary: This merges VFPtrInfo and VBTableInfo into VPtrInfo, since they hold almost the same information. With that change, the vbtable mangling code can easily be applied to vftable data and we magically get the correct, unambiguous vftable names. Fixes PR17748. Reviewers: timurrrr, majnemer CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2893 llvm-svn: 202425
* [MS ABI] Error instead of generating bad vftables for certain virtual ↵Hans Wennborg2014-02-271-0/+37
| | | | | | | | | | | hierarchies (PR18967) Erroring out until we fix the bug means we don't have to keep chasing down this same miscompile in a bunch of different places. Differential Revision: http://llvm-reviews.chandlerc.com/D2890 llvm-svn: 202331
* MS ABI: Let non-virtual method overloads participate in vftable orderingReid Kleckner2014-02-191-5/+3
| | | | | | | | | | | | | In the Microsoft ABI, the vftable is laid out as if all methods in every overload set were declared in reverse order of declaration at the point of declaration of the first overload in the set. Previously we only considered virtual methods in an overload set, but MSVC includes non-virtual methods for ordering purposes. Fixes PR18902. llvm-svn: 201722
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-5/+5
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-201-3/+3
| | | | | | | | | | | | | | | | | Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
* Make helper function static.Benjamin Kramer2014-01-111-1/+1
| | | | llvm-svn: 199013
* [ms-cxxabi] Improve vbtable name mangling accuracyReid Kleckner2014-01-031-162/+101
| | | | | | | | | | | | | | | | | | | | | | Summary: This makes us more compatible with MSVC 2012+ and fixes PR17748 where we would give two tables the same name. Rather than doing a fresh depth-first traversal of the inheritance graph for every record's vbtables, now we memoize vbtable paths for each record. By doing memoization, we end up considering virtual bases of subobjects that come later in the depth-first traversal. Where previously we would have ignored a virtual base that we'd already seen, we now consider it for name mangling purposes without emitting a duplicate vbtable for it. Reviewers: majnemer CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2509 llvm-svn: 198462
* Removed one of the string versions of getQualifiedNameAsString, and switched ↵Aaron Ballman2014-01-031-18/+33
| | | | | | over to using printQualifiedName where possible. No functional changes intended. llvm-svn: 198433
OpenPOWER on IntegriCloud