summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CXXInheritance.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-041-4/+4
| | | | | | avoid specifying the vector size unnecessarily. llvm-svn: 185610
* Fix CastDavid Greene2013-01-151-1/+2
| | | | | | Avoid a cast-away-const error by properly using const_cast<>. llvm-svn: 172558
* Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as ↵David Blaikie2012-12-191-11/+11
| | | | | | | | | | | | | | | per review discussion in r170365 This does limit these typedefs to being sequences, but no current usage requires them to be contiguous (we could expand this to a more general iterator pair range concept at some point). Also, it'd be nice if SmallVector were constructible directly from an ArrayRef but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the inverse conversion. (& generalizing over all range-like things, while nice, would require some nontrivial SFINAE I haven't thought about yet) llvm-svn: 170482
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Fix CXXRecordDecl::forallBases to not look through bases which are dependentRichard Smith2012-11-221-2/+14
| | | | | | | | and defined within the current instantiation, but which are not part of the current instantiation. Previously, it would look at bases which could be specialized separately from the current template. llvm-svn: 168477
* Rework my implementation of circular-reference finding to not useDouglas Gregor2012-11-101-5/+5
| | | | | | | CXXRecordDecl::forallBases, which does *not* do what I need. Fixes the failure introduced in r167651. llvm-svn: 167668
* Diagnostic circular inheritance involving dependent base classes. WeDouglas Gregor2012-11-101-5/+5
| | | | | | | would have diagnosed this at instantiation time anyway, if only we didn't hang on all of these test cases. Fixes <rdar://problem/12629723> llvm-svn: 167651
* Convert a few more getAs cases to castAs where we immediately call a member ↵Ted Kremenek2012-09-121-2/+2
| | | | | | function. llvm-svn: 163684
* Switch a SmallPtrSet/SmallVector pair over to SetVector.Douglas Gregor2012-09-111-4/+3
| | | | llvm-svn: 163600
* Change a bunch of cases where we do "getAs<...>->doSomething()" toTed Kremenek2012-08-231-8/+11
| | | | | | | | | "castAs<...>->doSomething()". The analyzer was flagging these as potential null dereferences, which is technically true. The invariants appear to be that these casts should never fail, so let's use castAs<> instead and avoid a runtime check. llvm-svn: 162468
* array_pod_sort on the addresses of declaration pointers leads toDouglas Gregor2012-08-231-5/+3
| | | | | | | inconsistent ordering of results; instead, use use SmallPtrSet to eliminate duplicates. llvm-svn: 162429
* Constify CXXRecordDecl::isVirtuallyDerivedFrom.Jordan Rose2012-08-081-4/+8
| | | | | | | No functionality change. A couple ugly const_casts because the ancestor search code is used for other purposes as well. llvm-svn: 161509
* Remove get(V)BaseClassOffsetInBits, the CharUnit functions should be used ↵Benjamin Kramer2012-07-041-0/+1
| | | | | | | | instead. No functionality change. llvm-svn: 159719
* PR12962: Fix a rare use after free when collecting virtual overrides.Benjamin Kramer2012-05-271-2/+7
| | | | | | | The DenseMap reallocates after 64 insertions so this only happened in large test cases under very specific circumstances. llvm-svn: 157549
* Actually remove the duplicated elements from the vector.Benjamin Kramer2012-02-231-1/+1
| | | | llvm-svn: 151270
* Unique CXXBasePath decls with the SmallVector/pod_sort/std::unique idiom ↵Benjamin Kramer2012-02-231-6/+9
| | | | | | instead of employing a wasteful std::set. llvm-svn: 151255
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-6/+6
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-1/+1
| | | | llvm-svn: 129567
* Fix some corner cases in the __is_base_of logic.John McCall2011-01-281-3/+6
| | | | llvm-svn: 124505
* Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.Anders Carlsson2010-11-241-1/+1
| | | | llvm-svn: 120133
* Fix typo.Anders Carlsson2010-11-241-2/+2
| | | | llvm-svn: 120130
* Add CXXRecordDecl::getIndirectPrimaryBases.Anders Carlsson2010-11-241-0/+48
| | | | llvm-svn: 120129
* Add a short circuit in isVirtuallyDerivedFrom.Anders Carlsson2010-06-041-0/+3
| | | | llvm-svn: 105457
* Add all final overriders to the map.Anders Carlsson2010-06-031-14/+21
| | | | llvm-svn: 105374
* Use CanQualType to enforce the use of a canonical type argument toDouglas Gregor2010-05-211-3/+2
| | | | | | | CXXBasePaths::isAmbiguous(), rather than just asserting that we have a canonical type. Fixes PR7176. llvm-svn: 104374
* Implement computation of the final overriders for each virtualDouglas Gregor2010-03-231-0/+237
| | | | | | | | | | | | | | | | | | | | function within a class hierarchy (C++ [class.virtual]p2). We use the final-overrider computation to determine when a particular class is ill-formed because it has multiple final overriders for a given virtual function (e.g., because two virtual functions override the same virtual function in the same virtual base class). Fixes PR5973. We also use the final-overrider computation to determine which virtual member functions are pure when determining whether a class is abstract or diagnosing the improper use of an abstract class. The prior approach to determining whether there were any pure virtual functions in a class didn't cope with virtual base class subobjects properly, and could not easily be fixed to deal with the oddities of subobject hiding. Fixes PR6631. llvm-svn: 99351
* Implement name hiding for names found through virtual base subobjectsDouglas Gregor2010-03-031-1/+83
| | | | | | | | that are hidden by other derived base subobjects reached along a lookup path that does *not* pass through the hiding subobject (C++ [class.member.lookup]p6). Fixes PR6462. llvm-svn: 97640
* Refactor CXXRecordDecl::lookupInBases() to push the recursion down aDouglas Gregor2010-03-031-27/+35
| | | | | | | level. No functionality change, and it obeys access control this time. llvm-svn: 97634
* Revert r97618. Access control sucksDouglas Gregor2010-03-031-18/+9
| | | | llvm-svn: 97621
* Factor out the recursive lookup into C++ base classes into a separate,Douglas Gregor2010-03-031-9/+18
| | | | | | static function. No functionality change. llvm-svn: 97618
* Eliminate the ASTContext parameter from RecordDecl::getDefinition()Douglas Gregor2010-02-111-2/+1
| | | | | | | and CXXRecordDecl::getDefinition(); it's totally unnecessary. No functionality change. llvm-svn: 95836
* Reset the found-virtual-base state unless the *current* base produces a path,John McCall2010-02-091-4/+7
| | | | | | | | not *any* base up to now has produced a path. Fixes PR 6254. I'll do the access-control part of this patch RSN. llvm-svn: 95638
* Implement elementary access control.John McCall2010-01-231-14/+28
| | | | llvm-svn: 94268
* First pass at collecting access-specifier information along inheritance paths.John McCall2010-01-201-2/+18
| | | | | | | | Triggers lots of assertions about missing access information; fix them. Will actually consume this information soon. llvm-svn: 94038
* In CXXRecordDecl::forallBases, add the base to the "queue", so we walk more ↵Anders Carlsson2009-12-091-2/+4
| | | | | | than one heirarchy of classes. John, please review. llvm-svn: 90948
* Add CXXRecordDecl::forallBases to walk an inheritance hierarchy with non-lookupJohn McCall2009-12-081-0/+49
| | | | | | | semantics and CXXRecordDecl::isProvablyNotDerivedFrom to assist with pre-instantiation diagnostics. llvm-svn: 90842
* First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor2009-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) llvm-svn: 88969
* Random const correctness, and incidentally use computeDeclContext when buildingJohn McCall2009-11-121-12/+13
| | | | | | a using declaration. llvm-svn: 86942
* Canonicality is a property of qualified types, not unqualified types.John McCall2009-10-221-1/+1
| | | | llvm-svn: 84891
* Fix eof.Mike Stump2009-10-061-1/+1
| | | | llvm-svn: 83433
* Refactor the code that walks a C++ inheritance hierarchy, searchingDouglas Gregor2009-10-061-0/+244
for bases, members, overridden virtual methods, etc. The operations isDerivedFrom and lookupInBases are now provided by CXXRecordDecl, rather than by Sema, so that CodeGen and other clients can use them directly. llvm-svn: 83396
OpenPOWER on IntegriCloud