summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CXXInheritance.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing spaceFangrui Song2018-07-301-32/+32
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* [AST] Various micro-optimizations in CXXInheritanceBenjamin Kramer2018-07-201-10/+10
| | | | | | | | | | | | | | | | | 1. Pack std::pair<bool, unsigned> in CXXBasePaths::ClassSubobjects. 2. Use a SmallPtrSet instead of a SmallDenseSet for CXXBasePaths::VisitedDependentRecords. 3. Reorder some members of CXXBasePaths to save 8 bytes. 4. Use a SmallSetVector instead of a SetVector in CXXBasePaths::ComputeDeclsFound to avoid some allocations. This speeds up an -fsyntax-only on all of Boost by approx 0.15%, mainly by speeding up CXXBasePaths::lookupInBases by approx 10%. No functional changes. Patch by Bruno Ricci! Differential Revision: https://reviews.llvm.org/D49302 llvm-svn: 337607
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-4/+4
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* Remove redundant casts. NFCGeorge Burgess IV2018-03-011-3/+2
| | | | | | | | | | | | | | | | | | | So I wrote a clang-tidy check to lint out redundant `isa`, `cast`, and `dyn_cast`s for fun. This is a portion of what it found for clang; I plan to do similar cleanups in LLVM and other subprojects when I find time. Because of the volume of changes, I explicitly avoided making any change that wasn't highly local and obviously correct to me (e.g. we still have a number of foo(cast<Bar>(baz)) that I didn't touch, since overloading is a thing and the cast<Bar> did actually change the type -- just up the class hierarchy). I also tried to leave the types we were cast<>ing to somewhere nearby, in cases where it wasn't locally obvious what we were dealing with before. llvm-svn: 326416
* Refactor overridden methods iteration to avoid double lookups.Benjamin Kramer2017-12-171-11/+8
| | | | | | Convert most uses to range-for loops. No functionality change intended. llvm-svn: 320954
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-301-21/+36
| | | | | | minor fixes (NFC). llvm-svn: 319487
* [index] Avoid one more crash caused by infinite recursion that happens whenAlex Lorenz2017-05-181-2/+10
| | | | | | | | | | looking up a dependent name in a record that derives from itself rdar://32273000 Differential Revision: https://reviews.llvm.org/D33324 llvm-svn: 303366
* [index] Avoid another crash that happens when looking up a dependent nameAlex Lorenz2017-05-161-0/+2
| | | | | | | | in a record that has a base without a definition rdar://32224197 llvm-svn: 303192
* [index] Index simple dependent declaration referencesAlex Lorenz2017-05-101-18/+94
| | | | | | | | | | | | This commit implements basic support for indexing of dependent declaration references. Now the indexer tries to find a suitable match in the base template for a dependent member ref/decl ref/dependent type. rdar://29158210 Differential Revision: https://reviews.llvm.org/D32972 llvm-svn: 302632
* Remove unused lambda captures. NFCMalcolm Parsons2017-01-131-2/+2
| | | | llvm-svn: 291939
* [NFC] Header cleanupMehdi Amini2016-07-181-1/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* Fix PR27601 by reverting [r267453] - Refactor traversal of bases in ↵Faisal Vali2016-05-191-9/+6
| | | | | | | | | | | | deduction of template parameters from base This reversal is being done with r267453's author's (i.e. Richard Smith's) permission. This fixes https://llvm.org/bugs/show_bug.cgi?id=27601 Also, per Richard's request the examples from the bug report have been added to our test suite. llvm-svn: 270016
* Refactor traversal of bases in deduction of template parameters from baseRichard Smith2016-04-251-6/+9
| | | | | | | classes of an argument to use CXXRecordDecl::forallBases. Fix forallBases to only visit each base class once. llvm-svn: 267453
* [OPENMP 4.0] Initial support for 'omp declare reduction' construct.Alexey Bataev2016-03-031-0/+15
| | | | | | | | | | | | | | | | | Add parsing, sema analysis and serialization/deserialization for 'declare reduction' construct. User-defined reductions are defined as #pragma omp declare reduction( reduction-identifier : typename-list : combiner ) [initializer ( initializer-expr )] These custom reductions may be used in 'reduction' clauses of OpenMP constructs. The combiner specifies how partial results can be combined into a single value. The combiner can use the special variable identifiers omp_in and omp_out that are of the type of the variables being reduced with this reduction-identifier. Each of them will denote one of the values to be combined before executing the combiner. It is assumed that the special omp_out identifier will refer to the storage that holds the resulting combined value after executing the combiner. As the initializer-expr value of a user-defined reduction is not known a priori the initializer-clause can be used to specify one. Then the contents of the initializer-clause will be used as the initializer for private copies of reduction list items where the omp_priv identifier will refer to the storage to be initialized. The special identifier omp_orig can also appear in the initializer-clause and it will refer to the storage of the original variable to be reduced. Differential Revision: http://reviews.llvm.org/D11182 llvm-svn: 262582
* unique_ptrify CXXBasePaths::DeclsFound & remove the then-unnecessary ↵David Blaikie2015-08-181-4/+4
| | | | | | | | | user-defined dtor Maybe this and the NumDeclsFound member should just be a std::vector instead. (it could be a std::dynarray, but that missed standardization) llvm-svn: 245392
* Capture 'this' so GCC 4.7 can find a static members.Benjamin Kramer2015-07-251-4/+6
| | | | llvm-svn: 243218
* [AST] Turn the callbacks of lookupInBases and forallBases into a function_refBenjamin Kramer2015-07-251-37/+34
| | | | | | | | | This lets us pass functors (and lambdas) without void * tricks. On the downside we can't pass CXXRecordDecl's Find* members (which are now type safe) to lookupInBases directly, but a lambda trampoline is a small price to pay. No functionality change intended. llvm-svn: 243217
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* CXXInheritance: Modernize removal of hidden virtual base class decls.Benjamin Kramer2015-02-111-76/+42
| | | | | | NFC. llvm-svn: 228864
* Update APIs that return a pair of iterators to return an iterator_range instead.Benjamin Kramer2015-02-061-12/+8
| | | | | | Convert uses of those APIs into ranged for loops. NFC. llvm-svn: 228404
* [C++11] Use 'nullptr'. AST edition.Craig Topper2014-05-121-6/+6
| | | | llvm-svn: 208517
* [C++11] Removing the found_decls_begin() and found_decls_end() APIs and ↵Aaron Ballman2014-03-141-7/+3
| | | | | | replacing with a range-only found_decls() API. llvm-svn: 203975
* [C++11] Replacing CXXRecordDecl iterators method_begin() and method_end() ↵Aaron Ballman2014-03-131-4/+1
| | | | | | 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 bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-30/+23
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* Use pop_back_val() instead of both back() and pop_back().Robert Wilhelm2013-08-231-3/+3
| | | | | | No functionality change intended. llvm-svn: 189112
* 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
OpenPOWER on IntegriCloud