|
15 | 15 | #ifndef LLVM_CLANG_AST_DECLCXX_H
|
16 | 16 | #define LLVM_CLANG_AST_DECLCXX_H
|
17 | 17 |
|
18 |
| -#include "clang/AST/ASTContext.h" |
19 | 18 | #include "clang/AST/ASTUnresolvedSet.h"
|
20 | 19 | #include "clang/AST/Decl.h"
|
21 | 20 | #include "clang/AST/DeclBase.h"
|
|
40 | 39 | #include "llvm/ADT/PointerIntPair.h"
|
41 | 40 | #include "llvm/ADT/PointerUnion.h"
|
42 | 41 | #include "llvm/ADT/STLExtras.h"
|
| 42 | +#include "llvm/ADT/TinyPtrVector.h" |
43 | 43 | #include "llvm/ADT/iterator_range.h"
|
44 | 44 | #include "llvm/Support/Casting.h"
|
45 | 45 | #include "llvm/Support/Compiler.h"
|
|
53 | 53 |
|
54 | 54 | namespace clang {
|
55 | 55 |
|
| 56 | +class ASTContext; |
56 | 57 | class ClassTemplateDecl;
|
57 | 58 | class ConstructorUsingShadowDecl;
|
58 | 59 | class CXXBasePath;
|
@@ -1166,7 +1167,7 @@ class CXXRecordDecl : public RecordDecl {
|
1166 | 1167 | bool defaultedDefaultConstructorIsConstexpr() const {
|
1167 | 1168 | return data().DefaultedDefaultConstructorIsConstexpr &&
|
1168 | 1169 | (!isUnion() || hasInClassInitializer() || !hasVariantMembers() ||
|
1169 |
| - getASTContext().getLangOpts().CPlusPlus2a); |
| 1170 | + getLangOpts().CPlusPlus2a); |
1170 | 1171 | }
|
1171 | 1172 |
|
1172 | 1173 | /// Determine whether this class has a constexpr default constructor.
|
@@ -1258,7 +1259,7 @@ class CXXRecordDecl : public RecordDecl {
|
1258 | 1259 | /// would be constexpr.
|
1259 | 1260 | bool defaultedDestructorIsConstexpr() const {
|
1260 | 1261 | return data().DefaultedDestructorIsConstexpr &&
|
1261 |
| - getASTContext().getLangOpts().CPlusPlus2a; |
| 1262 | + getLangOpts().CPlusPlus2a; |
1262 | 1263 | }
|
1263 | 1264 |
|
1264 | 1265 | /// Determine whether this class has a constexpr destructor.
|
@@ -1355,10 +1356,10 @@ class CXXRecordDecl : public RecordDecl {
|
1355 | 1356 | ///
|
1356 | 1357 | /// Only in C++17 and beyond, are lambdas literal types.
|
1357 | 1358 | bool isLiteral() const {
|
1358 |
| - ASTContext &Ctx = getASTContext(); |
1359 |
| - return (Ctx.getLangOpts().CPlusPlus2a ? hasConstexprDestructor() |
| 1359 | + const LangOptions &LangOpts = getLangOpts(); |
| 1360 | + return (LangOpts.CPlusPlus2a ? hasConstexprDestructor() |
1360 | 1361 | : hasTrivialDestructor()) &&
|
1361 |
| - (!isLambda() || Ctx.getLangOpts().CPlusPlus17) && |
| 1362 | + (!isLambda() || LangOpts.CPlusPlus17) && |
1362 | 1363 | !hasNonLiteralTypeFieldsOrBases() &&
|
1363 | 1364 | (isAggregate() || isLambda() ||
|
1364 | 1365 | hasConstexprNonCopyMoveConstructor() ||
|
@@ -2035,7 +2036,8 @@ class CXXMethodDecl : public FunctionDecl {
|
2035 | 2036 | method_iterator end_overridden_methods() const;
|
2036 | 2037 | unsigned size_overridden_methods() const;
|
2037 | 2038 |
|
2038 |
| - using overridden_method_range= ASTContext::overridden_method_range; |
| 2039 | + using overridden_method_range = llvm::iterator_range< |
| 2040 | + llvm::TinyPtrVector<const CXXMethodDecl *>::const_iterator>; |
2039 | 2041 |
|
2040 | 2042 | overridden_method_range overridden_methods() const;
|
2041 | 2043 |
|
|
0 commit comments