Coverage Report

Created: 2018-12-11 17:59

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/AST/DeclBase.h
Line
Count
Source (jump to first uncovered line)
1
//===- DeclBase.h - Base Classes for representing declarations --*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
//  This file defines the Decl and DeclContext interfaces.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CLANG_AST_DECLBASE_H
15
#define LLVM_CLANG_AST_DECLBASE_H
16
17
#include "clang/AST/AttrIterator.h"
18
#include "clang/AST/DeclarationName.h"
19
#include "clang/Basic/IdentifierTable.h"
20
#include "clang/Basic/LLVM.h"
21
#include "clang/Basic/SourceLocation.h"
22
#include "clang/Basic/Specifiers.h"
23
#include "llvm/ADT/ArrayRef.h"
24
#include "llvm/ADT/PointerIntPair.h"
25
#include "llvm/ADT/PointerUnion.h"
26
#include "llvm/ADT/iterator.h"
27
#include "llvm/ADT/iterator_range.h"
28
#include "llvm/Support/Casting.h"
29
#include "llvm/Support/Compiler.h"
30
#include "llvm/Support/PrettyStackTrace.h"
31
#include "llvm/Support/VersionTuple.h"
32
#include <algorithm>
33
#include <cassert>
34
#include <cstddef>
35
#include <iterator>
36
#include <string>
37
#include <type_traits>
38
#include <utility>
39
40
namespace clang {
41
42
class ASTContext;
43
class ASTMutationListener;
44
class Attr;
45
class DeclContext;
46
class ExternalSourceSymbolAttr;
47
class FunctionDecl;
48
class FunctionType;
49
class IdentifierInfo;
50
enum Linkage : unsigned char;
51
class LinkageSpecDecl;
52
class Module;
53
class NamedDecl;
54
class ObjCCategoryDecl;
55
class ObjCCategoryImplDecl;
56
class ObjCContainerDecl;
57
class ObjCImplDecl;
58
class ObjCImplementationDecl;
59
class ObjCInterfaceDecl;
60
class ObjCMethodDecl;
61
class ObjCProtocolDecl;
62
struct PrintingPolicy;
63
class RecordDecl;
64
class SourceManager;
65
class Stmt;
66
class StoredDeclsMap;
67
class TemplateDecl;
68
class TranslationUnitDecl;
69
class UsingDirectiveDecl;
70
71
/// Captures the result of checking the availability of a
72
/// declaration.
73
enum AvailabilityResult {
74
  AR_Available = 0,
75
  AR_NotYetIntroduced,
76
  AR_Deprecated,
77
  AR_Unavailable
78
};
79
80
/// Decl - This represents one declaration (or definition), e.g. a variable,
81
/// typedef, function, struct, etc.
82
///
83
/// Note: There are objects tacked on before the *beginning* of Decl
84
/// (and its subclasses) in its Decl::operator new(). Proper alignment
85
/// of all subclasses (not requiring more than the alignment of Decl) is
86
/// asserted in DeclBase.cpp.
87
class alignas(8) Decl {
88
public:
89
  /// Lists the kind of concrete classes of Decl.
90
  enum Kind {
91
#define DECL(DERIVED, BASE) DERIVED,
92
#define ABSTRACT_DECL(DECL)
93
#define DECL_RANGE(BASE, START, END) \
94
        first##BASE = START, last##BASE = END,
95
#define LAST_DECL_RANGE(BASE, START, END) \
96
        first##BASE = START, last##BASE = END
97
#include "clang/AST/DeclNodes.inc"
98
  };
99
100
  /// A placeholder type used to construct an empty shell of a
101
  /// decl-derived type that will be filled in later (e.g., by some
102
  /// deserialization method).
103
  struct EmptyShell {};
104
105
  /// IdentifierNamespace - The different namespaces in which
106
  /// declarations may appear.  According to C99 6.2.3, there are
107
  /// four namespaces, labels, tags, members and ordinary
108
  /// identifiers.  C++ describes lookup completely differently:
109
  /// certain lookups merely "ignore" certain kinds of declarations,
110
  /// usually based on whether the declaration is of a type, etc.
111
  ///
112
  /// These are meant as bitmasks, so that searches in
113
  /// C++ can look into the "tag" namespace during ordinary lookup.
114
  ///
115
  /// Decl currently provides 15 bits of IDNS bits.
116
  enum IdentifierNamespace {
117
    /// Labels, declared with 'x:' and referenced with 'goto x'.
118
    IDNS_Label               = 0x0001,
119
120
    /// Tags, declared with 'struct foo;' and referenced with
121
    /// 'struct foo'.  All tags are also types.  This is what
122
    /// elaborated-type-specifiers look for in C.
123
    /// This also contains names that conflict with tags in the
124
    /// same scope but that are otherwise ordinary names (non-type
125
    /// template parameters and indirect field declarations).
126
    IDNS_Tag                 = 0x0002,
127
128
    /// Types, declared with 'struct foo', typedefs, etc.
129
    /// This is what elaborated-type-specifiers look for in C++,
130
    /// but note that it's ill-formed to find a non-tag.
131
    IDNS_Type                = 0x0004,
132
133
    /// Members, declared with object declarations within tag
134
    /// definitions.  In C, these can only be found by "qualified"
135
    /// lookup in member expressions.  In C++, they're found by
136
    /// normal lookup.
137
    IDNS_Member              = 0x0008,
138
139
    /// Namespaces, declared with 'namespace foo {}'.
140
    /// Lookup for nested-name-specifiers find these.
141
    IDNS_Namespace           = 0x0010,
142
143
    /// Ordinary names.  In C, everything that's not a label, tag,
144
    /// member, or function-local extern ends up here.
145
    IDNS_Ordinary            = 0x0020,
146
147
    /// Objective C \@protocol.
148
    IDNS_ObjCProtocol        = 0x0040,
149
150
    /// This declaration is a friend function.  A friend function
151
    /// declaration is always in this namespace but may also be in
152
    /// IDNS_Ordinary if it was previously declared.
153
    IDNS_OrdinaryFriend      = 0x0080,
154
155
    /// This declaration is a friend class.  A friend class
156
    /// declaration is always in this namespace but may also be in
157
    /// IDNS_Tag|IDNS_Type if it was previously declared.
158
    IDNS_TagFriend           = 0x0100,
159
160
    /// This declaration is a using declaration.  A using declaration
161
    /// *introduces* a number of other declarations into the current
162
    /// scope, and those declarations use the IDNS of their targets,
163
    /// but the actual using declarations go in this namespace.
164
    IDNS_Using               = 0x0200,
165
166
    /// This declaration is a C++ operator declared in a non-class
167
    /// context.  All such operators are also in IDNS_Ordinary.
168
    /// C++ lexical operator lookup looks for these.
169
    IDNS_NonMemberOperator   = 0x0400,
170
171
    /// This declaration is a function-local extern declaration of a
172
    /// variable or function. This may also be IDNS_Ordinary if it
173
    /// has been declared outside any function. These act mostly like
174
    /// invisible friend declarations, but are also visible to unqualified
175
    /// lookup within the scope of the declaring function.
176
    IDNS_LocalExtern         = 0x0800,
177
178
    /// This declaration is an OpenMP user defined reduction construction.
179
    IDNS_OMPReduction        = 0x1000
180
  };
181
182
  /// ObjCDeclQualifier - 'Qualifiers' written next to the return and
183
  /// parameter types in method declarations.  Other than remembering
184
  /// them and mangling them into the method's signature string, these
185
  /// are ignored by the compiler; they are consumed by certain
186
  /// remote-messaging frameworks.
187
  ///
188
  /// in, inout, and out are mutually exclusive and apply only to
189
  /// method parameters.  bycopy and byref are mutually exclusive and
190
  /// apply only to method parameters (?).  oneway applies only to
191
  /// results.  All of these expect their corresponding parameter to
192
  /// have a particular type.  None of this is currently enforced by
193
  /// clang.
194
  ///
195
  /// This should be kept in sync with ObjCDeclSpec::ObjCDeclQualifier.
196
  enum ObjCDeclQualifier {
197
    OBJC_TQ_None = 0x0,
198
    OBJC_TQ_In = 0x1,
199
    OBJC_TQ_Inout = 0x2,
200
    OBJC_TQ_Out = 0x4,
201
    OBJC_TQ_Bycopy = 0x8,
202
    OBJC_TQ_Byref = 0x10,
203
    OBJC_TQ_Oneway = 0x20,
204
205
    /// The nullability qualifier is set when the nullability of the
206
    /// result or parameter was expressed via a context-sensitive
207
    /// keyword.
208
    OBJC_TQ_CSNullability = 0x40
209
  };
210
211
  /// The kind of ownership a declaration has, for visibility purposes.
212
  /// This enumeration is designed such that higher values represent higher
213
  /// levels of name hiding.
214
  enum class ModuleOwnershipKind : unsigned {
215
    /// This declaration is not owned by a module.
216
    Unowned,
217
218
    /// This declaration has an owning module, but is globally visible
219
    /// (typically because its owning module is visible and we know that
220
    /// modules cannot later become hidden in this compilation).
221
    /// After serialization and deserialization, this will be converted
222
    /// to VisibleWhenImported.
223
    Visible,
224
225
    /// This declaration has an owning module, and is visible when that
226
    /// module is imported.
227
    VisibleWhenImported,
228
229
    /// This declaration has an owning module, but is only visible to
230
    /// lookups that occur within that module.
231
    ModulePrivate
232
  };
233
234
protected:
235
  /// The next declaration within the same lexical
236
  /// DeclContext. These pointers form the linked list that is
237
  /// traversed via DeclContext's decls_begin()/decls_end().
238
  ///
239
  /// The extra two bits are used for the ModuleOwnershipKind.
240
  llvm::PointerIntPair<Decl *, 2, ModuleOwnershipKind> NextInContextAndBits;
241
242
private:
243
  friend class DeclContext;
244
245
  struct MultipleDC {
246
    DeclContext *SemanticDC;
247
    DeclContext *LexicalDC;
248
  };
249
250
  /// DeclCtx - Holds either a DeclContext* or a MultipleDC*.
251
  /// For declarations that don't contain C++ scope specifiers, it contains
252
  /// the DeclContext where the Decl was declared.
253
  /// For declarations with C++ scope specifiers, it contains a MultipleDC*
254
  /// with the context where it semantically belongs (SemanticDC) and the
255
  /// context where it was lexically declared (LexicalDC).
256
  /// e.g.:
257
  ///
258
  ///   namespace A {
259
  ///      void f(); // SemanticDC == LexicalDC == 'namespace A'
260
  ///   }
261
  ///   void A::f(); // SemanticDC == namespace 'A'
262
  ///                // LexicalDC == global namespace
263
  llvm::PointerUnion<DeclContext*, MultipleDC*> DeclCtx;
264
265
3.85G
  bool isInSemaDC() const { return DeclCtx.is<DeclContext*>(); }
266
0
  bool isOutOfSemaDC() const { return DeclCtx.is<MultipleDC*>(); }
267
268
160M
  MultipleDC *getMultipleDC() const {
269
160M
    return DeclCtx.get<MultipleDC*>();
270
160M
  }
271
272
3.69G
  DeclContext *getSemanticDC() const {
273
3.69G
    return DeclCtx.get<DeclContext*>();
274
3.69G
  }
275
276
  /// Loc - The location of this decl.
277
  SourceLocation Loc;
278
279
  /// DeclKind - This indicates which class this is.
280
  unsigned DeclKind : 7;
281
282
  /// InvalidDecl - This indicates a semantic error occurred.
283
  unsigned InvalidDecl :  1;
284
285
  /// HasAttrs - This indicates whether the decl has attributes or not.
286
  unsigned HasAttrs : 1;
287
288
  /// Implicit - Whether this declaration was implicitly generated by
289
  /// the implementation rather than explicitly written by the user.
290
  unsigned Implicit : 1;
291
292
  /// Whether this declaration was "used", meaning that a definition is
293
  /// required.
294
  unsigned Used : 1;
295
296
  /// Whether this declaration was "referenced".
297
  /// The difference with 'Used' is whether the reference appears in a
298
  /// evaluated context or not, e.g. functions used in uninstantiated templates
299
  /// are regarded as "referenced" but not "used".
300
  unsigned Referenced : 1;
301
302
  /// Whether this declaration is a top-level declaration (function,
303
  /// global variable, etc.) that is lexically inside an objc container
304
  /// definition.
305
  unsigned TopLevelDeclInObjCContainer : 1;
306
307
  /// Whether statistic collection is enabled.
308
  static bool StatisticsEnabled;
309
310
protected:
311
  friend class ASTDeclReader;
312
  friend class ASTDeclWriter;
313
  friend class ASTNodeImporter;
314
  friend class ASTReader;
315
  friend class CXXClassMemberWrapper;
316
  friend class LinkageComputer;
317
  template<typename decl_type> friend class Redeclarable;
318
319
  /// Access - Used by C++ decls for the access specifier.
320
  // NOTE: VC++ treats enums as signed, avoid using the AccessSpecifier enum
321
  unsigned Access : 2;
322
323
  /// Whether this declaration was loaded from an AST file.
324
  unsigned FromASTFile : 1;
325
326
  /// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
327
  unsigned IdentifierNamespace : 13;
328
329
  /// If 0, we have not computed the linkage of this declaration.
330
  /// Otherwise, it is the linkage + 1.
331
  mutable unsigned CacheValidAndLinkage : 3;
332
333
  /// Allocate memory for a deserialized declaration.
334
  ///
335
  /// This routine must be used to allocate memory for any declaration that is
336
  /// deserialized from a module file.
337
  ///
338
  /// \param Size The size of the allocated object.
339
  /// \param Ctx The context in which we will allocate memory.
340
  /// \param ID The global ID of the deserialized declaration.
341
  /// \param Extra The amount of extra space to allocate after the object.
342
  void *operator new(std::size_t Size, const ASTContext &Ctx, unsigned ID,
343
                     std::size_t Extra = 0);
344
345
  /// Allocate memory for a non-deserialized declaration.
346
  void *operator new(std::size_t Size, const ASTContext &Ctx,
347
                     DeclContext *Parent, std::size_t Extra = 0);
348
349
private:
350
  bool AccessDeclContextSanity() const;
351
352
  /// Get the module ownership kind to use for a local lexical child of \p DC,
353
  /// which may be either a local or (rarely) an imported declaration.
354
54.8M
  static ModuleOwnershipKind getModuleOwnershipKindForChildOf(DeclContext *DC) {
355
54.8M
    if (DC) {
356
54.3M
      auto *D = cast<Decl>(DC);
357
54.3M
      auto MOK = D->getModuleOwnershipKind();
358
54.3M
      if (MOK != ModuleOwnershipKind::Unowned &&
359
54.3M
          
(263k
!D->isFromASTFile()263k
||
D->hasLocalOwningModuleStorage()10.4k
))
360
253k
        return MOK;
361
54.6M
      // If D is not local and we have no local module storage, then we don't
362
54.6M
      // need to track module ownership at all.
363
54.6M
    }
364
54.6M
    return ModuleOwnershipKind::Unowned;
365
54.6M
  }
366
367
protected:
368
  Decl(Kind DK, DeclContext *DC, SourceLocation L)
369
      : NextInContextAndBits(nullptr, getModuleOwnershipKindForChildOf(DC)),
370
        DeclCtx(DC), Loc(L), DeclKind(DK), InvalidDecl(false), HasAttrs(false),
371
        Implicit(false), Used(false), Referenced(false),
372
        TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0),
373
        IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
374
54.2M
        CacheValidAndLinkage(0) {
375
54.2M
    if (StatisticsEnabled) 
add(DK)61
;
376
54.2M
  }
377
378
  Decl(Kind DK, EmptyShell Empty)
379
      : DeclKind(DK), InvalidDecl(false), HasAttrs(false), Implicit(false),
380
        Used(false), Referenced(false), TopLevelDeclInObjCContainer(false),
381
        Access(AS_none), FromASTFile(0),
382
        IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
383
808
        CacheValidAndLinkage(0) {
384
808
    if (StatisticsEnabled) 
add(DK)0
;
385
808
  }
386
387
  virtual ~Decl();
388
389
  /// Update a potentially out-of-date declaration.
390
  void updateOutOfDate(IdentifierInfo &II) const;
391
392
57.9M
  Linkage getCachedLinkage() const {
393
57.9M
    return Linkage(CacheValidAndLinkage - 1);
394
57.9M
  }
395
396
14.3M
  void setCachedLinkage(Linkage L) const {
397
14.3M
    CacheValidAndLinkage = L + 1;
398
14.3M
  }
399
400
81.9M
  bool hasCachedLinkage() const {
401
81.9M
    return CacheValidAndLinkage;
402
81.9M
  }
403
404
public:
405
  /// Source range that this declaration covers.
406
349
  virtual SourceRange getSourceRange() const LLVM_READONLY {
407
349
    return SourceRange(getLocation(), getLocation());
408
349
  }
409
410
5.36M
  SourceLocation getBeginLoc() const LLVM_READONLY {
411
5.36M
    return getSourceRange().getBegin();
412
5.36M
  }
413
414
2.34M
  SourceLocation getEndLoc() const LLVM_READONLY {
415
2.34M
    return getSourceRange().getEnd();
416
2.34M
  }
417
418
170M
  SourceLocation getLocation() const { return Loc; }
419
1.56M
  void setLocation(SourceLocation L) { Loc = L; }
420
421
7.58G
  Kind getKind() const { return static_cast<Kind>(DeclKind); }
422
  const char *getDeclKindName() const;
423
424
135M
  Decl *getNextDeclInContext() { return NextInContextAndBits.getPointer(); }
425
7
  const Decl *getNextDeclInContext() const {return NextInContextAndBits.getPointer();}
426
427
3.55G
  DeclContext *getDeclContext() {
428
3.55G
    if (isInSemaDC())
429
3.41G
      return getSemanticDC();
430
143M
    return getMultipleDC()->SemanticDC;
431
143M
  }
432
723M
  const DeclContext *getDeclContext() const {
433
723M
    return const_cast<Decl*>(this)->getDeclContext();
434
723M
  }
435
436
  /// Find the innermost non-closure ancestor of this declaration,
437
  /// walking up through blocks, lambdas, etc.  If that ancestor is
438
  /// not a code context (!isFunctionOrMethod()), returns null.
439
  ///
440
  /// A declaration may be its own non-closure context.
441
  Decl *getNonClosureContext();
442
462k
  const Decl *getNonClosureContext() const {
443
462k
    return const_cast<Decl*>(this)->getNonClosureContext();
444
462k
  }
445
446
  TranslationUnitDecl *getTranslationUnitDecl();
447
877M
  const TranslationUnitDecl *getTranslationUnitDecl() const {
448
877M
    return const_cast<Decl*>(this)->getTranslationUnitDecl();
449
877M
  }
450
451
  bool isInAnonymousNamespace() const;
452
453
  bool isInStdNamespace() const;
454
455
  ASTContext &getASTContext() const LLVM_READONLY;
456
457
25.3M
  void setAccess(AccessSpecifier AS) {
458
25.3M
    Access = AS;
459
25.3M
    assert(AccessDeclContextSanity());
460
25.3M
  }
461
462
147M
  AccessSpecifier getAccess() const {
463
147M
    assert(AccessDeclContextSanity());
464
147M
    return AccessSpecifier(Access);
465
147M
  }
466
467
  /// Retrieve the access specifier for this declaration, even though
468
  /// it may not yet have been properly set.
469
29.2k
  AccessSpecifier getAccessUnsafe() const {
470
29.2k
    return AccessSpecifier(Access);
471
29.2k
  }
472
473
1.33G
  bool hasAttrs() const { return HasAttrs; }
474
475
6.29M
  void setAttrs(const AttrVec& Attrs) {
476
6.29M
    return setAttrsImpl(Attrs, getASTContext());
477
6.29M
  }
478
479
5.59M
  AttrVec &getAttrs() {
480
5.59M
    return const_cast<AttrVec&>(const_cast<const Decl*>(this)->getAttrs());
481
5.59M
  }
482
483
  const AttrVec &getAttrs() const;
484
  void dropAttrs();
485
  void addAttr(Attr *A);
486
487
  using attr_iterator = AttrVec::const_iterator;
488
  using attr_range = llvm::iterator_range<attr_iterator>;
489
490
88.4M
  attr_range attrs() const {
491
88.4M
    return attr_range(attr_begin(), attr_end());
492
88.4M
  }
493
494
174M
  attr_iterator attr_begin() const {
495
174M
    return hasAttrs() ? 
getAttrs().begin()24.9M
:
nullptr149M
;
496
174M
  }
497
174M
  attr_iterator attr_end() const {
498
174M
    return hasAttrs() ? 
getAttrs().end()24.9M
:
nullptr149M
;
499
174M
  }
500
501
  template <typename T>
502
26.9k
  void dropAttr() {
503
26.9k
    if (!HasAttrs) 
return17.7k
;
504
9.20k
505
9.20k
    AttrVec &Vec = getAttrs();
506
9.20k
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
9.20k
508
9.20k
    if (Vec.empty())
509
1.31k
      HasAttrs = false;
510
9.20k
  }
void clang::Decl::dropAttr<clang::DLLImportAttr>()
Line
Count
Source
502
13.8k
  void dropAttr() {
503
13.8k
    if (!HasAttrs) 
return8.81k
;
504
5.04k
505
5.04k
    AttrVec &Vec = getAttrs();
506
5.04k
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
5.04k
508
5.04k
    if (Vec.empty())
509
1.04k
      HasAttrs = false;
510
5.04k
  }
void clang::Decl::dropAttr<clang::WeakAttr>()
Line
Count
Source
502
10
  void dropAttr() {
503
10
    if (!HasAttrs) 
return0
;
504
10
505
10
    AttrVec &Vec = getAttrs();
506
10
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
10
508
10
    if (Vec.empty())
509
10
      HasAttrs = false;
510
10
  }
void clang::Decl::dropAttr<clang::WeakRefAttr>()
Line
Count
Source
502
5
  void dropAttr() {
503
5
    if (!HasAttrs) 
return0
;
504
5
505
5
    AttrVec &Vec = getAttrs();
506
5
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
5
508
5
    if (Vec.empty())
509
2
      HasAttrs = false;
510
5
  }
void clang::Decl::dropAttr<clang::SelectAnyAttr>()
Line
Count
Source
502
16
  void dropAttr() {
503
16
    if (!HasAttrs) 
return0
;
504
16
505
16
    AttrVec &Vec = getAttrs();
506
16
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
16
508
16
    if (Vec.empty())
509
16
      HasAttrs = false;
510
16
  }
void clang::Decl::dropAttr<clang::NotTailCalledAttr>()
Line
Count
Source
502
2
  void dropAttr() {
503
2
    if (!HasAttrs) 
return0
;
504
2
505
2
    AttrVec &Vec = getAttrs();
506
2
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
2
508
2
    if (Vec.empty())
509
2
      HasAttrs = false;
510
2
  }
void clang::Decl::dropAttr<clang::InternalLinkageAttr>()
Line
Count
Source
502
3
  void dropAttr() {
503
3
    if (!HasAttrs) 
return0
;
504
3
505
3
    AttrVec &Vec = getAttrs();
506
3
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
3
508
3
    if (Vec.empty())
509
3
      HasAttrs = false;
510
3
  }
void clang::Decl::dropAttr<clang::OverloadableAttr>()
Line
Count
Source
502
3
  void dropAttr() {
503
3
    if (!HasAttrs) 
return0
;
504
3
505
3
    AttrVec &Vec = getAttrs();
506
3
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
3
508
3
    if (Vec.empty())
509
2
      HasAttrs = false;
510
3
  }
void clang::Decl::dropAttr<clang::WeakImportAttr>()
Line
Count
Source
502
2
  void dropAttr() {
503
2
    if (!HasAttrs) 
return0
;
504
2
505
2
    AttrVec &Vec = getAttrs();
506
2
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
2
508
2
    if (Vec.empty())
509
2
      HasAttrs = false;
510
2
  }
void clang::Decl::dropAttr<clang::AliasAttr>()
Line
Count
Source
502
5
  void dropAttr() {
503
5
    if (!HasAttrs) 
return0
;
504
5
505
5
    AttrVec &Vec = getAttrs();
506
5
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
5
508
5
    if (Vec.empty())
509
5
      HasAttrs = false;
510
5
  }
void clang::Decl::dropAttr<clang::SectionAttr>()
Line
Count
Source
502
3
  void dropAttr() {
503
3
    if (!HasAttrs) 
return0
;
504
3
505
3
    AttrVec &Vec = getAttrs();
506
3
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
3
508
3
    if (Vec.empty())
509
3
      HasAttrs = false;
510
3
  }
void clang::Decl::dropAttr<clang::AvailabilityAttr>()
Line
Count
Source
502
6
  void dropAttr() {
503
6
    if (!HasAttrs) 
return0
;
504
6
505
6
    AttrVec &Vec = getAttrs();
506
6
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
6
508
6
    if (Vec.empty())
509
2
      HasAttrs = false;
510
6
  }
void clang::Decl::dropAttr<clang::UsedAttr>()
Line
Count
Source
502
4
  void dropAttr() {
503
4
    if (!HasAttrs) 
return0
;
504
4
505
4
    AttrVec &Vec = getAttrs();
506
4
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
4
508
4
    if (Vec.empty())
509
4
      HasAttrs = false;
510
4
  }
void clang::Decl::dropAttr<clang::IFuncAttr>()
Line
Count
Source
502
1
  void dropAttr() {
503
1
    if (!HasAttrs) 
return0
;
504
1
505
1
    AttrVec &Vec = getAttrs();
506
1
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
1
508
1
    if (Vec.empty())
509
1
      HasAttrs = false;
510
1
  }
void clang::Decl::dropAttr<clang::CodeSegAttr>()
Line
Count
Source
502
8
  void dropAttr() {
503
8
    if (!HasAttrs) 
return0
;
504
8
505
8
    AttrVec &Vec = getAttrs();
506
8
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
8
508
8
    if (Vec.empty())
509
5
      HasAttrs = false;
510
8
  }
void clang::Decl::dropAttr<clang::VisibilityAttr>()
Line
Count
Source
502
6
  void dropAttr() {
503
6
    if (!HasAttrs) 
return0
;
504
6
505
6
    AttrVec &Vec = getAttrs();
506
6
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
6
508
6
    if (Vec.empty())
509
6
      HasAttrs = false;
510
6
  }
Unexecuted instantiation: void clang::Decl::dropAttr<clang::TypeVisibilityAttr>()
void clang::Decl::dropAttr<clang::AlwaysInlineAttr>()
Line
Count
Source
502
7
  void dropAttr() {
503
7
    if (!HasAttrs) 
return0
;
504
7
505
7
    AttrVec &Vec = getAttrs();
506
7
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
7
508
7
    if (Vec.empty())
509
7
      HasAttrs = false;
510
7
  }
void clang::Decl::dropAttr<clang::MinSizeAttr>()
Line
Count
Source
502
3
  void dropAttr() {
503
3
    if (!HasAttrs) 
return0
;
504
3
505
3
    AttrVec &Vec = getAttrs();
506
3
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
3
508
3
    if (Vec.empty())
509
3
      HasAttrs = false;
510
3
  }
void clang::Decl::dropAttr<clang::UuidAttr>()
Line
Count
Source
502
16
  void dropAttr() {
503
16
    if (!HasAttrs) 
return0
;
504
16
505
16
    AttrVec &Vec = getAttrs();
506
16
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
16
508
16
    if (Vec.empty())
509
16
      HasAttrs = false;
510
16
  }
void clang::Decl::dropAttr<clang::MSInheritanceAttr>()
Line
Count
Source
502
3
  void dropAttr() {
503
3
    if (!HasAttrs) 
return0
;
504
3
505
3
    AttrVec &Vec = getAttrs();
506
3
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
3
508
3
    if (Vec.empty())
509
3
      HasAttrs = false;
510
3
  }
void clang::Decl::dropAttr<clang::TrivialABIAttr>()
Line
Count
Source
502
21
  void dropAttr() {
503
21
    if (!HasAttrs) 
return0
;
504
21
505
21
    AttrVec &Vec = getAttrs();
506
21
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
21
508
21
    if (Vec.empty())
509
21
      HasAttrs = false;
510
21
  }
void clang::Decl::dropAttr<clang::OverrideAttr>()
Line
Count
Source
502
8
  void dropAttr() {
503
8
    if (!HasAttrs) 
return0
;
504
8
505
8
    AttrVec &Vec = getAttrs();
506
8
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
8
508
8
    if (Vec.empty())
509
8
      HasAttrs = false;
510
8
  }
void clang::Decl::dropAttr<clang::FinalAttr>()
Line
Count
Source
502
6
  void dropAttr() {
503
6
    if (!HasAttrs) 
return0
;
504
6
505
6
    AttrVec &Vec = getAttrs();
506
6
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
6
508
6
    if (Vec.empty())
509
6
      HasAttrs = false;
510
6
  }
void clang::Decl::dropAttr<clang::DLLExportAttr>()
Line
Count
Source
502
12.9k
  void dropAttr() {
503
12.9k
    if (!HasAttrs) 
return8.89k
;
504
4.02k
505
4.02k
    AttrVec &Vec = getAttrs();
506
4.02k
    Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
507
4.02k
508
4.02k
    if (Vec.empty())
509
142
      HasAttrs = false;
510
4.02k
  }
511
512
  template <typename T>
513
85.2M
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
85.2M
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
85.2M
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::NonNullAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::NonNullAttr>() const
Line
Count
Source
513
4.40M
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
4.40M
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
4.40M
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::OMPDeclareSimdDeclAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::OMPDeclareSimdDeclAttr>() const
Line
Count
Source
513
78
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
78
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
78
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::NoSanitizeAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::NoSanitizeAttr>() const
Line
Count
Source
513
462k
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
462k
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
462k
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::AnnotateAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::AnnotateAttr>() const
Line
Count
Source
513
11.3k
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
11.3k
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
11.3k
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::FormatAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::FormatAttr>() const
Line
Count
Source
513
4.26M
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
4.26M
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
4.26M
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::OwnershipAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::OwnershipAttr>() const
Line
Count
Source
513
139
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
139
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
139
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::EnableIfAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::EnableIfAttr>() const
Line
Count
Source
513
6.67M
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
6.67M
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
6.67M
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::FormatArgAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::FormatArgAttr>() const
Line
Count
Source
513
26
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
26
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
26
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::ArgumentWithTypeTagAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::ArgumentWithTypeTagAttr>() const
Line
Count
Source
513
4.14M
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
4.14M
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
4.14M
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::AlignedAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::AlignedAttr>() const
Line
Count
Source
513
934k
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
934k
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
934k
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::InheritableParamAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::InheritableParamAttr>() const
Line
Count
Source
513
873
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
873
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
873
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::InheritableAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::InheritableAttr>() const
Line
Count
Source
513
354k
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
354k
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
354k
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::TypeTagForDatatypeAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::TypeTagForDatatypeAttr>() const
Line
Count
Source
513
101
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
101
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
101
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::DiagnoseIfAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::DiagnoseIfAttr>() const
Line
Count
Source
513
64.0M
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
64.0M
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
64.0M
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::PtGuardedByAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::PtGuardedByAttr>() const
Line
Count
Source
513
442
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
442
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
442
  }
llvm::iterator_range<clang::specific_attr_iterator<clang::GuardedByAttr, llvm::SmallVector<clang::Attr*, 4u> > > clang::Decl::specific_attrs<clang::GuardedByAttr>() const
Line
Count
Source
513
2.41k
  llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
514
2.41k
    return llvm::make_range(specific_attr_begin<T>(), specific_attr_end<T>());
515
2.41k
  }
516
517
  template <typename T>
518
86.3M
  specific_attr_iterator<T> specific_attr_begin() const {
519
86.3M
    return specific_attr_iterator<T>(attr_begin());
520
86.3M
  }
clang::specific_attr_iterator<clang::NonNullAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::NonNullAttr>() const
Line
Count
Source
518
4.40M
  specific_attr_iterator<T> specific_attr_begin() const {
519
4.40M
    return specific_attr_iterator<T>(attr_begin());
520
4.40M
  }
clang::specific_attr_iterator<clang::OMPDeclareSimdDeclAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::OMPDeclareSimdDeclAttr>() const
Line
Count
Source
518
78
  specific_attr_iterator<T> specific_attr_begin() const {
519
78
    return specific_attr_iterator<T>(attr_begin());
520
78
  }
clang::specific_attr_iterator<clang::NoSanitizeAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::NoSanitizeAttr>() const
Line
Count
Source
518
462k
  specific_attr_iterator<T> specific_attr_begin() const {
519
462k
    return specific_attr_iterator<T>(attr_begin());
520
462k
  }
clang::specific_attr_iterator<clang::AnnotateAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::AnnotateAttr>() const
Line
Count
Source
518
11.7k
  specific_attr_iterator<T> specific_attr_begin() const {
519
11.7k
    return specific_attr_iterator<T>(attr_begin());
520
11.7k
  }
clang::specific_attr_iterator<clang::FormatAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::FormatAttr>() const
Line
Count
Source
518
4.26M
  specific_attr_iterator<T> specific_attr_begin() const {
519
4.26M
    return specific_attr_iterator<T>(attr_begin());
520
4.26M
  }
clang::specific_attr_iterator<clang::OwnershipAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::OwnershipAttr>() const
Line
Count
Source
518
139
  specific_attr_iterator<T> specific_attr_begin() const {
519
139
    return specific_attr_iterator<T>(attr_begin());
520
139
  }
clang::specific_attr_iterator<clang::EnableIfAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::EnableIfAttr>() const
Line
Count
Source
518
7.76M
  specific_attr_iterator<T> specific_attr_begin() const {
519
7.76M
    return specific_attr_iterator<T>(attr_begin());
520
7.76M
  }
clang::specific_attr_iterator<clang::FormatArgAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::FormatArgAttr>() const
Line
Count
Source
518
26
  specific_attr_iterator<T> specific_attr_begin() const {
519
26
    return specific_attr_iterator<T>(attr_begin());
520
26
  }
clang::specific_attr_iterator<clang::ArgumentWithTypeTagAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::ArgumentWithTypeTagAttr>() const
Line
Count
Source
518
4.14M
  specific_attr_iterator<T> specific_attr_begin() const {
519
4.14M
    return specific_attr_iterator<T>(attr_begin());
520
4.14M
  }
clang::specific_attr_iterator<clang::AlignedAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::AlignedAttr>() const
Line
Count
Source
518
934k
  specific_attr_iterator<T> specific_attr_begin() const {
519
934k
    return specific_attr_iterator<T>(attr_begin());
520
934k
  }
clang::specific_attr_iterator<clang::InheritableParamAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::InheritableParamAttr>() const
Line
Count
Source
518
873
  specific_attr_iterator<T> specific_attr_begin() const {
519
873
    return specific_attr_iterator<T>(attr_begin());
520
873
  }
clang::specific_attr_iterator<clang::InheritableAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::InheritableAttr>() const
Line
Count
Source
518
354k
  specific_attr_iterator<T> specific_attr_begin() const {
519
354k
    return specific_attr_iterator<T>(attr_begin());
520
354k
  }
clang::specific_attr_iterator<clang::TypeTagForDatatypeAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::TypeTagForDatatypeAttr>() const
Line
Count
Source
518
101
  specific_attr_iterator<T> specific_attr_begin() const {
519
101
    return specific_attr_iterator<T>(attr_begin());
520
101
  }
clang::specific_attr_iterator<clang::DiagnoseIfAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::DiagnoseIfAttr>() const
Line
Count
Source
518
64.0M
  specific_attr_iterator<T> specific_attr_begin() const {
519
64.0M
    return specific_attr_iterator<T>(attr_begin());
520
64.0M
  }
clang::specific_attr_iterator<clang::PtGuardedByAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::PtGuardedByAttr>() const
Line
Count
Source
518
442
  specific_attr_iterator<T> specific_attr_begin() const {
519
442
    return specific_attr_iterator<T>(attr_begin());
520
442
  }
clang::specific_attr_iterator<clang::GuardedByAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_begin<clang::GuardedByAttr>() const
Line
Count
Source
518
2.41k
  specific_attr_iterator<T> specific_attr_begin() const {
519
2.41k
    return specific_attr_iterator<T>(attr_begin());
520
2.41k
  }
521
522
  template <typename T>
523
86.3M
  specific_attr_iterator<T> specific_attr_end() const {
524
86.3M
    return specific_attr_iterator<T>(attr_end());
525
86.3M
  }
clang::specific_attr_iterator<clang::NonNullAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::NonNullAttr>() const
Line
Count
Source
523
4.40M
  specific_attr_iterator<T> specific_attr_end() const {
524
4.40M
    return specific_attr_iterator<T>(attr_end());
525
4.40M
  }
clang::specific_attr_iterator<clang::OMPDeclareSimdDeclAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::OMPDeclareSimdDeclAttr>() const
Line
Count
Source
523
78
  specific_attr_iterator<T> specific_attr_end() const {
524
78
    return specific_attr_iterator<T>(attr_end());
525
78
  }
clang::specific_attr_iterator<clang::NoSanitizeAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::NoSanitizeAttr>() const
Line
Count
Source
523
462k
  specific_attr_iterator<T> specific_attr_end() const {
524
462k
    return specific_attr_iterator<T>(attr_end());
525
462k
  }
clang::specific_attr_iterator<clang::AnnotateAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::AnnotateAttr>() const
Line
Count
Source
523
11.7k
  specific_attr_iterator<T> specific_attr_end() const {
524
11.7k
    return specific_attr_iterator<T>(attr_end());
525
11.7k
  }
clang::specific_attr_iterator<clang::FormatAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::FormatAttr>() const
Line
Count
Source
523
4.26M
  specific_attr_iterator<T> specific_attr_end() const {
524
4.26M
    return specific_attr_iterator<T>(attr_end());
525
4.26M
  }
clang::specific_attr_iterator<clang::OwnershipAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::OwnershipAttr>() const
Line
Count
Source
523
139
  specific_attr_iterator<T> specific_attr_end() const {
524
139
    return specific_attr_iterator<T>(attr_end());
525
139
  }
clang::specific_attr_iterator<clang::EnableIfAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::EnableIfAttr>() const
Line
Count
Source
523
7.76M
  specific_attr_iterator<T> specific_attr_end() const {
524
7.76M
    return specific_attr_iterator<T>(attr_end());
525
7.76M
  }
clang::specific_attr_iterator<clang::FormatArgAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::FormatArgAttr>() const
Line
Count
Source
523
26
  specific_attr_iterator<T> specific_attr_end() const {
524
26
    return specific_attr_iterator<T>(attr_end());
525
26
  }
clang::specific_attr_iterator<clang::ArgumentWithTypeTagAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::ArgumentWithTypeTagAttr>() const
Line
Count
Source
523
4.14M
  specific_attr_iterator<T> specific_attr_end() const {
524
4.14M
    return specific_attr_iterator<T>(attr_end());
525
4.14M
  }
clang::specific_attr_iterator<clang::AlignedAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::AlignedAttr>() const
Line
Count
Source
523
934k
  specific_attr_iterator<T> specific_attr_end() const {
524
934k
    return specific_attr_iterator<T>(attr_end());
525
934k
  }
clang::specific_attr_iterator<clang::InheritableParamAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::InheritableParamAttr>() const
Line
Count
Source
523
873
  specific_attr_iterator<T> specific_attr_end() const {
524
873
    return specific_attr_iterator<T>(attr_end());
525
873
  }
clang::specific_attr_iterator<clang::InheritableAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::InheritableAttr>() const
Line
Count
Source
523
354k
  specific_attr_iterator<T> specific_attr_end() const {
524
354k
    return specific_attr_iterator<T>(attr_end());
525
354k
  }
clang::specific_attr_iterator<clang::TypeTagForDatatypeAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::TypeTagForDatatypeAttr>() const
Line
Count
Source
523
101
  specific_attr_iterator<T> specific_attr_end() const {
524
101
    return specific_attr_iterator<T>(attr_end());
525
101
  }
clang::specific_attr_iterator<clang::DiagnoseIfAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::DiagnoseIfAttr>() const
Line
Count
Source
523
64.0M
  specific_attr_iterator<T> specific_attr_end() const {
524
64.0M
    return specific_attr_iterator<T>(attr_end());
525
64.0M
  }
clang::specific_attr_iterator<clang::PtGuardedByAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::PtGuardedByAttr>() const
Line
Count
Source
523
442
  specific_attr_iterator<T> specific_attr_end() const {
524
442
    return specific_attr_iterator<T>(attr_end());
525
442
  }
clang::specific_attr_iterator<clang::GuardedByAttr, llvm::SmallVector<clang::Attr*, 4u> > clang::Decl::specific_attr_end<clang::GuardedByAttr>() const
Line
Count
Source
523
2.41k
  specific_attr_iterator<T> specific_attr_end() const {
524
2.41k
    return specific_attr_iterator<T>(attr_end());
525
2.41k
  }
526
527
316M
  template<typename T> T *getAttr() const {
528
316M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())88.5M
:
nullptr227M
;
529
316M
  }
clang::OMPDeclareTargetDeclAttr* clang::Decl::getAttr<clang::OMPDeclareTargetDeclAttr>() const
Line
Count
Source
527
11.6k
  template<typename T> T *getAttr() const {
528
11.6k
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
11.6k
  }
clang::DLLImportAttr* clang::Decl::getAttr<clang::DLLImportAttr>() const
Line
Count
Source
527
17.9M
  template<typename T> T *getAttr() const {
528
17.9M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4.43M
:
nullptr13.5M
;
529
17.9M
  }
clang::DLLExportAttr* clang::Decl::getAttr<clang::DLLExportAttr>() const
Line
Count
Source
527
17.9M
  template<typename T> T *getAttr() const {
528
17.9M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4.44M
:
nullptr13.5M
;
529
17.9M
  }
clang::ReturnsNonNullAttr* clang::Decl::getAttr<clang::ReturnsNonNullAttr>() const
Line
Count
Source
527
2.71k
  template<typename T> T *getAttr() const {
528
2.71k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())1.02k
:
nullptr1.68k
;
529
2.71k
  }
clang::PassObjectSizeAttr* clang::Decl::getAttr<clang::PassObjectSizeAttr>() const
Line
Count
Source
527
11.5M
  template<typename T> T *getAttr() const {
528
11.5M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.13k
:
nullptr11.5M
;
529
11.5M
  }
clang::XRayInstrumentAttr* clang::Decl::getAttr<clang::XRayInstrumentAttr>() const
Line
Count
Source
527
461k
  template<typename T> T *getAttr() const {
528
461k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())140k
:
nullptr321k
;
529
461k
  }
clang::PcsAttr* clang::Decl::getAttr<clang::PcsAttr>() const
Line
Count
Source
527
3.79k
  template<typename T> T *getAttr() const {
528
3.79k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())209
:
nullptr3.58k
;
529
3.79k
  }
clang::NonNullAttr* clang::Decl::getAttr<clang::NonNullAttr>() const
Line
Count
Source
527
203k
  template<typename T> T *getAttr() const {
528
203k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())324
:
nullptr203k
;
529
203k
  }
clang::AllocSizeAttr* clang::Decl::getAttr<clang::AllocSizeAttr>() const
Line
Count
Source
527
1.75M
  template<typename T> T *getAttr() const {
528
1.75M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())508k
:
nullptr1.24M
;
529
1.75M
  }
clang::AlignValueAttr* clang::Decl::getAttr<clang::AlignValueAttr>() const
Line
Count
Source
527
2.96M
  template<typename T> T *getAttr() const {
528
2.96M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())6.49k
:
nullptr2.96M
;
529
2.96M
  }
clang::AssumeAlignedAttr* clang::Decl::getAttr<clang::AssumeAlignedAttr>() const
Line
Count
Source
527
1.11M
  template<typename T> T *getAttr() const {
528
1.11M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())339k
:
nullptr777k
;
529
1.11M
  }
clang::AllocAlignAttr* clang::Decl::getAttr<clang::AllocAlignAttr>() const
Line
Count
Source
527
1.11M
  template<typename T> T *getAttr() const {
528
1.11M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())339k
:
nullptr777k
;
529
1.11M
  }
clang::PragmaClangBSSSectionAttr* clang::Decl::getAttr<clang::PragmaClangBSSSectionAttr>() const
Line
Count
Source
527
63.7k
  template<typename T> T *getAttr() const {
528
63.7k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())16.2k
:
nullptr47.5k
;
529
63.7k
  }
clang::PragmaClangDataSectionAttr* clang::Decl::getAttr<clang::PragmaClangDataSectionAttr>() const
Line
Count
Source
527
63.7k
  template<typename T> T *getAttr() const {
528
63.7k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())16.2k
:
nullptr47.5k
;
529
63.7k
  }
clang::PragmaClangRodataSectionAttr* clang::Decl::getAttr<clang::PragmaClangRodataSectionAttr>() const
Line
Count
Source
527
63.7k
  template<typename T> T *getAttr() const {
528
63.7k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())16.2k
:
nullptr47.5k
;
529
63.7k
  }
clang::SectionAttr* clang::Decl::getAttr<clang::SectionAttr>() const
Line
Count
Source
527
1.37M
  template<typename T> T *getAttr() const {
528
1.37M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())363k
:
nullptr1.00M
;
529
1.37M
  }
clang::CleanupAttr* clang::Decl::getAttr<clang::CleanupAttr>() const
Line
Count
Source
527
597k
  template<typename T> T *getAttr() const {
528
597k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())17.3k
:
nullptr579k
;
529
597k
  }
clang::OMPThreadPrivateDeclAttr* clang::Decl::getAttr<clang::OMPThreadPrivateDeclAttr>() const
Line
Count
Source
527
48
  template<typename T> T *getAttr() const {
528
48
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
48
  }
clang::InitSegAttr* clang::Decl::getAttr<clang::InitSegAttr>() const
Line
Count
Source
527
4.53k
  template<typename T> T *getAttr() const {
528
4.53k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())814
:
nullptr3.72k
;
529
4.53k
  }
clang::InitPriorityAttr* clang::Decl::getAttr<clang::InitPriorityAttr>() const
Line
Count
Source
527
4.46k
  template<typename T> T *getAttr() const {
528
4.46k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())794
:
nullptr3.66k
;
529
4.46k
  }
clang::AsmLabelAttr* clang::Decl::getAttr<clang::AsmLabelAttr>() const
Line
Count
Source
527
1.81M
  template<typename T> T *getAttr() const {
528
1.81M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())739k
:
nullptr1.07M
;
529
1.81M
  }
clang::OMPCaptureKindAttr* clang::Decl::getAttr<clang::OMPCaptureKindAttr>() const
Line
Count
Source
527
162
  template<typename T> T *getAttr() const {
528
162
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
162
  }
clang::OpenCLAccessAttr* clang::Decl::getAttr<clang::OpenCLAccessAttr>() const
Line
Count
Source
527
90
  template<typename T> T *getAttr() const {
528
90
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())80
:
nullptr10
;
529
90
  }
clang::VecTypeHintAttr* clang::Decl::getAttr<clang::VecTypeHintAttr>() const
Line
Count
Source
527
3.92M
  template<typename T> T *getAttr() const {
528
3.92M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.57M
:
nullptr347k
;
529
3.92M
  }
clang::WorkGroupSizeHintAttr* clang::Decl::getAttr<clang::WorkGroupSizeHintAttr>() const
Line
Count
Source
527
3.92M
  template<typename T> T *getAttr() const {
528
3.92M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.57M
:
nullptr347k
;
529
3.92M
  }
clang::ReqdWorkGroupSizeAttr* clang::Decl::getAttr<clang::ReqdWorkGroupSizeAttr>() const
Line
Count
Source
527
3.92M
  template<typename T> T *getAttr() const {
528
3.92M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.57M
:
nullptr347k
;
529
3.92M
  }
clang::OpenCLIntelReqdSubGroupSizeAttr* clang::Decl::getAttr<clang::OpenCLIntelReqdSubGroupSizeAttr>() const
Line
Count
Source
527
3.92M
  template<typename T> T *getAttr() const {
528
3.92M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.57M
:
nullptr347k
;
529
3.92M
  }
clang::XRayLogArgsAttr* clang::Decl::getAttr<clang::XRayLogArgsAttr>() const
Line
Count
Source
527
1.75k
  template<typename T> T *getAttr() const {
528
1.75k
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
1.75k
  }
clang::MinVectorWidthAttr* clang::Decl::getAttr<clang::MinVectorWidthAttr>() const
Line
Count
Source
527
1.00M
  template<typename T> T *getAttr() const {
528
1.00M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())689k
:
nullptr317k
;
529
1.00M
  }
clang::TargetAttr* clang::Decl::getAttr<clang::TargetAttr>() const
Line
Count
Source
527
11.2M
  template<typename T> T *getAttr() const {
528
11.2M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4.49M
:
nullptr6.79M
;
529
11.2M
  }
clang::TLSModelAttr* clang::Decl::getAttr<clang::TLSModelAttr>() const
Line
Count
Source
527
344
  template<typename T> T *getAttr() const {
528
344
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())96
:
nullptr248
;
529
344
  }
clang::CPUSpecificAttr* clang::Decl::getAttr<clang::CPUSpecificAttr>() const
Line
Count
Source
527
11.2M
  template<typename T> T *getAttr() const {
528
11.2M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4.45M
:
nullptr6.79M
;
529
11.2M
  }
clang::PragmaClangTextSectionAttr* clang::Decl::getAttr<clang::PragmaClangTextSectionAttr>() const
Line
Count
Source
527
455k
  template<typename T> T *getAttr() const {
528
455k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())139k
:
nullptr315k
;
529
455k
  }
clang::CodeSegAttr* clang::Decl::getAttr<clang::CodeSegAttr>() const
Line
Count
Source
527
5.76M
  template<typename T> T *getAttr() const {
528
5.76M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())1.68M
:
nullptr4.07M
;
529
5.76M
  }
clang::AliasAttr* clang::Decl::getAttr<clang::AliasAttr>() const
Line
Count
Source
527
6.52M
  template<typename T> T *getAttr() const {
528
6.52M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())2.39M
:
nullptr4.13M
;
529
6.52M
  }
clang::CPUDispatchAttr* clang::Decl::getAttr<clang::CPUDispatchAttr>() const
Line
Count
Source
527
10.2M
  template<typename T> T *getAttr() const {
528
10.2M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4.15M
:
nullptr6.08M
;
529
10.2M
  }
clang::ConstructorAttr* clang::Decl::getAttr<clang::ConstructorAttr>() const
Line
Count
Source
527
347k
  template<typename T> T *getAttr() const {
528
347k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())117k
:
nullptr230k
;
529
347k
  }
clang::DestructorAttr* clang::Decl::getAttr<clang::DestructorAttr>() const
Line
Count
Source
527
347k
  template<typename T> T *getAttr() const {
528
347k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())117k
:
nullptr230k
;
529
347k
  }
clang::IFuncAttr* clang::Decl::getAttr<clang::IFuncAttr>() const
Line
Count
Source
527
4.07M
  template<typename T> T *getAttr() const {
528
4.07M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())2.37M
:
nullptr1.70M
;
529
4.07M
  }
clang::MipsInterruptAttr* clang::Decl::getAttr<clang::MipsInterruptAttr>() const
Line
Count
Source
527
392
  template<typename T> T *getAttr() const {
528
392
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())64
:
nullptr328
;
529
392
  }
clang::AVRInterruptAttr* clang::Decl::getAttr<clang::AVRInterruptAttr>() const
Line
Count
Source
527
2
  template<typename T> T *getAttr() const {
528
2
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
2
  }
clang::AVRSignalAttr* clang::Decl::getAttr<clang::AVRSignalAttr>() const
Line
Count
Source
527
2
  template<typename T> T *getAttr() const {
528
2
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
2
  }
clang::ARMInterruptAttr* clang::Decl::getAttr<clang::ARMInterruptAttr>() const
Line
Count
Source
527
49.2k
  template<typename T> T *getAttr() const {
528
49.2k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())5.87k
:
nullptr43.3k
;
529
49.2k
  }
clang::CUDALaunchBoundsAttr* clang::Decl::getAttr<clang::CUDALaunchBoundsAttr>() const
Line
Count
Source
527
276
  template<typename T> T *getAttr() const {
528
276
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())272
:
nullptr4
;
529
276
  }
Unexecuted instantiation: clang::MSP430InterruptAttr* clang::Decl::getAttr<clang::MSP430InterruptAttr>() const
clang::RISCVInterruptAttr* clang::Decl::getAttr<clang::RISCVInterruptAttr>() const
Line
Count
Source
527
381
  template<typename T> T *getAttr() const {
528
381
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())30
:
nullptr351
;
529
381
  }
clang::AMDGPUFlatWorkGroupSizeAttr* clang::Decl::getAttr<clang::AMDGPUFlatWorkGroupSizeAttr>() const
Line
Count
Source
527
3.92M
  template<typename T> T *getAttr() const {
528
3.92M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.57M
:
nullptr347k
;
529
3.92M
  }
clang::AMDGPUWavesPerEUAttr* clang::Decl::getAttr<clang::AMDGPUWavesPerEUAttr>() const
Line
Count
Source
527
3.92M
  template<typename T> T *getAttr() const {
528
3.92M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.57M
:
nullptr347k
;
529
3.92M
  }
clang::AMDGPUNumSGPRAttr* clang::Decl::getAttr<clang::AMDGPUNumSGPRAttr>() const
Line
Count
Source
527
3.92M
  template<typename T> T *getAttr() const {
528
3.92M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.57M
:
nullptr347k
;
529
3.92M
  }
clang::AMDGPUNumVGPRAttr* clang::Decl::getAttr<clang::AMDGPUNumVGPRAttr>() const
Line
Count
Source
527
3.92M
  template<typename T> T *getAttr() const {
528
3.92M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.57M
:
nullptr347k
;
529
3.92M
  }
clang::BlocksAttr* clang::Decl::getAttr<clang::BlocksAttr>() const
Line
Count
Source
527
4
  template<typename T> T *getAttr() const {
528
4
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
4
  }
clang::FormatArgAttr* clang::Decl::getAttr<clang::FormatArgAttr>() const
Line
Count
Source
527
6
  template<typename T> T *getAttr() const {
528
6
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())5
:
nullptr1
;
529
6
  }
clang::TypeTagForDatatypeAttr* clang::Decl::getAttr<clang::TypeTagForDatatypeAttr>() const
Line
Count
Source
527
274
  template<typename T> T *getAttr() const {
528
274
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())261
:
nullptr13
;
529
274
  }
clang::SentinelAttr* clang::Decl::getAttr<clang::SentinelAttr>() const
Line
Count
Source
527
4.77M
  template<typename T> T *getAttr() const {
528
4.77M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())2.35M
:
nullptr2.42M
;
529
4.77M
  }
clang::CUDAGlobalAttr* clang::Decl::getAttr<clang::CUDAGlobalAttr>() const
Line
Count
Source
527
1.92k
  template<typename T> T *getAttr() const {
528
1.92k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())405
:
nullptr1.51k
;
529
1.92k
  }
clang::CUDAHostAttr* clang::Decl::getAttr<clang::CUDAHostAttr>() const
Line
Count
Source
527
165
  template<typename T> T *getAttr() const {
528
165
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())52
:
nullptr113
;
529
165
  }
clang::CUDADeviceAttr* clang::Decl::getAttr<clang::CUDADeviceAttr>() const
Line
Count
Source
527
167
  template<typename T> T *getAttr() const {
528
167
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())54
:
nullptr113
;
529
167
  }
clang::WeakAttr* clang::Decl::getAttr<clang::WeakAttr>() const
Line
Count
Source
527
10.5M
  template<typename T> T *getAttr() const {
528
10.5M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.38M
:
nullptr7.20M
;
529
10.5M
  }
clang::WeakRefAttr* clang::Decl::getAttr<clang::WeakRefAttr>() const
Line
Count
Source
527
10.5M
  template<typename T> T *getAttr() const {
528
10.5M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.38M
:
nullptr7.20M
;
529
10.5M
  }
clang::SelectAnyAttr* clang::Decl::getAttr<clang::SelectAnyAttr>() const
Line
Count
Source
527
25.5M
  template<typename T> T *getAttr() const {
528
25.5M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.58M
:
nullptr22.0M
;
529
25.5M
  }
clang::NotTailCalledAttr* clang::Decl::getAttr<clang::NotTailCalledAttr>() const
Line
Count
Source
527
11.5M
  template<typename T> T *getAttr() const {
528
11.5M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.45M
:
nullptr8.07M
;
529
11.5M
  }
clang::UsedAttr* clang::Decl::getAttr<clang::UsedAttr>() const
Line
Count
Source
527
4.20M
  template<typename T> T *getAttr() const {
528
4.20M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())401k
:
nullptr3.79M
;
529
4.20M
  }
clang::AbiTagAttr* clang::Decl::getAttr<clang::AbiTagAttr>() const
Line
Count
Source
527
6.75M
  template<typename T> T *getAttr() const {
528
6.75M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())1.78M
:
nullptr4.97M
;
529
6.75M
  }
clang::CarriesDependencyAttr* clang::Decl::getAttr<clang::CarriesDependencyAttr>() const
Line
Count
Source
527
1.54M
  template<typename T> T *getAttr() const {
528
1.54M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())67.8k
:
nullptr1.47M
;
529
1.54M
  }
clang::OverloadableAttr* clang::Decl::getAttr<clang::OverloadableAttr>() const
Line
Count
Source
527
247k
  template<typename T> T *getAttr() const {
528
247k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())247k
:
nullptr16
;
529
247k
  }
clang::AnyX86NoCallerSavedRegistersAttr* clang::Decl::getAttr<clang::AnyX86NoCallerSavedRegistersAttr>() const
Line
Count
Source
527
1
  template<typename T> T *getAttr() const {
528
1
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
1
  }
clang::CXX11NoReturnAttr* clang::Decl::getAttr<clang::CXX11NoReturnAttr>() const
Line
Count
Source
527
417k
  template<typename T> T *getAttr() const {
528
417k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())66.9k
:
nullptr350k
;
529
417k
  }
clang::AvailabilityAttr* clang::Decl::getAttr<clang::AvailabilityAttr>() const
Line
Count
Source
527
6.58M
  template<typename T> T *getAttr() const {
528
6.58M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())2.98M
:
nullptr3.59M
;
529
6.58M
  }
clang::RequireConstantInitAttr* clang::Decl::getAttr<clang::RequireConstantInitAttr>() const
Line
Count
Source
527
43
  template<typename T> T *getAttr() const {
528
43
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
43
  }
clang::DLLExportStaticLocalAttr* clang::Decl::getAttr<clang::DLLExportStaticLocalAttr>() const
Line
Count
Source
527
5
  template<typename T> T *getAttr() const {
528
5
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
5
  }
clang::DLLImportStaticLocalAttr* clang::Decl::getAttr<clang::DLLImportStaticLocalAttr>() const
Line
Count
Source
527
1
  template<typename T> T *getAttr() const {
528
1
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
1
  }
clang::NakedAttr* clang::Decl::getAttr<clang::NakedAttr>() const
Line
Count
Source
527
64
  template<typename T> T *getAttr() const {
528
64
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())9
:
nullptr55
;
529
64
  }
clang::MSInheritanceAttr* clang::Decl::getAttr<clang::MSInheritanceAttr>() const
Line
Count
Source
527
359k
  template<typename T> T *getAttr() const {
528
359k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())359k
:
nullptr58
;
529
359k
  }
clang::Mips16Attr* clang::Decl::getAttr<clang::Mips16Attr>() const
Line
Count
Source
527
28
  template<typename T> T *getAttr() const {
528
28
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4
:
nullptr24
;
529
28
  }
clang::MicroMipsAttr* clang::Decl::getAttr<clang::MicroMipsAttr>() const
Line
Count
Source
527
11
  template<typename T> T *getAttr() const {
528
11
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3
:
nullptr8
;
529
11
  }
clang::MipsShortCallAttr* clang::Decl::getAttr<clang::MipsShortCallAttr>() const
Line
Count
Source
527
16
  template<typename T> T *getAttr() const {
528
16
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4
:
nullptr12
;
529
16
  }
clang::MipsLongCallAttr* clang::Decl::getAttr<clang::MipsLongCallAttr>() const
Line
Count
Source
527
16
  template<typename T> T *getAttr() const {
528
16
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4
:
nullptr12
;
529
16
  }
clang::CUDASharedAttr* clang::Decl::getAttr<clang::CUDASharedAttr>() const
Line
Count
Source
527
119
  template<typename T> T *getAttr() const {
528
119
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4
:
nullptr115
;
529
119
  }
clang::HotAttr* clang::Decl::getAttr<clang::HotAttr>() const
Line
Count
Source
527
26
  template<typename T> T *getAttr() const {
528
26
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())4
:
nullptr22
;
529
26
  }
clang::ColdAttr* clang::Decl::getAttr<clang::ColdAttr>() const
Line
Count
Source
527
3
  template<typename T> T *getAttr() const {
528
3
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())1
:
nullptr2
;
529
3
  }
clang::DisableTailCallsAttr* clang::Decl::getAttr<clang::DisableTailCallsAttr>() const
Line
Count
Source
527
31
  template<typename T> T *getAttr() const {
528
31
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())1
:
nullptr30
;
529
31
  }
clang::CUDAConstantAttr* clang::Decl::getAttr<clang::CUDAConstantAttr>() const
Line
Count
Source
527
206
  template<typename T> T *getAttr() const {
528
206
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())6
:
nullptr200
;
529
206
  }
clang::VecReturnAttr* clang::Decl::getAttr<clang::VecReturnAttr>() const
Line
Count
Source
527
11
  template<typename T> T *getAttr() const {
528
11
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())1
:
nullptr10
;
529
11
  }
Unexecuted instantiation: clang::CFUnknownTransferAttr* clang::Decl::getAttr<clang::CFUnknownTransferAttr>() const
clang::CFAuditedTransferAttr* clang::Decl::getAttr<clang::CFAuditedTransferAttr>() const
Line
Count
Source
527
1
  template<typename T> T *getAttr() const {
528
1
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())0
: nullptr;
529
1
  }
clang::NoDestroyAttr* clang::Decl::getAttr<clang::NoDestroyAttr>() const
Line
Count
Source
527
16
  template<typename T> T *getAttr() const {
528
16
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())2
:
nullptr14
;
529
16
  }
clang::AlwaysDestroyAttr* clang::Decl::getAttr<clang::AlwaysDestroyAttr>() const
Line
Count
Source
527
14
  template<typename T> T *getAttr() const {
528
14
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())2
:
nullptr12
;
529
14
  }
clang::DeprecatedAttr* clang::Decl::getAttr<clang::DeprecatedAttr>() const
Line
Count
Source
527
4.55k
  template<typename T> T *getAttr() const {
528
4.55k
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
4.55k
  }
clang::UnavailableAttr* clang::Decl::getAttr<clang::UnavailableAttr>() const
Line
Count
Source
527
336
  template<typename T> T *getAttr() const {
528
336
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
336
  }
clang::VisibilityAttr* clang::Decl::getAttr<clang::VisibilityAttr>() const
Line
Count
Source
527
9.96M
  template<typename T> T *getAttr() const {
528
9.96M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())1.22M
:
nullptr8.74M
;
529
9.96M
  }
clang::TypeVisibilityAttr* clang::Decl::getAttr<clang::TypeVisibilityAttr>() const
Line
Count
Source
527
4.18M
  template<typename T> T *getAttr() const {
528
4.18M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())542k
:
nullptr3.63M
;
529
4.18M
  }
clang::OptimizeNoneAttr* clang::Decl::getAttr<clang::OptimizeNoneAttr>() const
Line
Count
Source
527
956k
  template<typename T> T *getAttr() const {
528
956k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())88.3k
:
nullptr868k
;
529
956k
  }
clang::InternalLinkageAttr* clang::Decl::getAttr<clang::InternalLinkageAttr>() const
Line
Count
Source
527
9
  template<typename T> T *getAttr() const {
528
9
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())2
:
nullptr7
;
529
9
  }
clang::CommonAttr* clang::Decl::getAttr<clang::CommonAttr>() const
Line
Count
Source
527
281
  template<typename T> T *getAttr() const {
528
281
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())251
:
nullptr30
;
529
281
  }
clang::AlwaysInlineAttr* clang::Decl::getAttr<clang::AlwaysInlineAttr>() const
Line
Count
Source
527
445
  template<typename T> T *getAttr() const {
528
445
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())272
:
nullptr173
;
529
445
  }
clang::MinSizeAttr* clang::Decl::getAttr<clang::MinSizeAttr>() const
Line
Count
Source
527
89
  template<typename T> T *getAttr() const {
528
89
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())13
:
nullptr76
;
529
89
  }
clang::ParameterABIAttr* clang::Decl::getAttr<clang::ParameterABIAttr>() const
Line
Count
Source
527
12.0M
  template<typename T> T *getAttr() const {
528
12.0M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())9.62k
:
nullptr12.0M
;
529
12.0M
  }
clang::UuidAttr* clang::Decl::getAttr<clang::UuidAttr>() const
Line
Count
Source
527
305
  template<typename T> T *getAttr() const {
528
305
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())167
:
nullptr138
;
529
305
  }
clang::TrivialABIAttr* clang::Decl::getAttr<clang::TrivialABIAttr>() const
Line
Count
Source
527
16
  template<typename T> T *getAttr() const {
528
16
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
16
  }
clang::FinalAttr* clang::Decl::getAttr<clang::FinalAttr>() const
Line
Count
Source
527
658k
  template<typename T> T *getAttr() const {
528
658k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())40.1k
:
nullptr617k
;
529
658k
  }
clang::OverrideAttr* clang::Decl::getAttr<clang::OverrideAttr>() const
Line
Count
Source
527
18
  template<typename T> T *getAttr() const {
528
18
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
18
  }
clang::UnusedAttr* clang::Decl::getAttr<clang::UnusedAttr>() const
Line
Count
Source
527
59.8M
  template<typename T> T *getAttr() const {
528
59.8M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.56M
:
nullptr56.3M
;
529
59.8M
  }
clang::ObjCBridgeRelatedAttr* clang::Decl::getAttr<clang::ObjCBridgeRelatedAttr>() const
Line
Count
Source
527
754
  template<typename T> T *getAttr() const {
528
754
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())461
:
nullptr293
;
529
754
  }
clang::ObjCBridgeAttr* clang::Decl::getAttr<clang::ObjCBridgeAttr>() const
Line
Count
Source
527
885k
  template<typename T> T *getAttr() const {
528
885k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())20.4k
:
nullptr865k
;
529
885k
  }
clang::ObjCBridgeMutableAttr* clang::Decl::getAttr<clang::ObjCBridgeMutableAttr>() const
Line
Count
Source
527
875k
  template<typename T> T *getAttr() const {
528
875k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())10.9k
:
nullptr865k
;
529
875k
  }
clang::WarnUnusedResultAttr* clang::Decl::getAttr<clang::WarnUnusedResultAttr>() const
Line
Count
Source
527
1.12M
  template<typename T> T *getAttr() const {
528
1.12M
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())310k
:
nullptr817k
;
529
1.12M
  }
clang::WarnUnusedAttr* clang::Decl::getAttr<clang::WarnUnusedAttr>() const
Line
Count
Source
527
5
  template<typename T> T *getAttr() const {
528
5
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())2
:
nullptr3
;
529
5
  }
clang::TestTypestateAttr* clang::Decl::getAttr<clang::TestTypestateAttr>() const
Line
Count
Source
527
43
  template<typename T> T *getAttr() const {
528
43
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
43
  }
clang::ConsumableAttr* clang::Decl::getAttr<clang::ConsumableAttr>() const
Line
Count
Source
527
42
  template<typename T> T *getAttr() const {
528
42
    return hasAttrs() ? getSpecificAttr<T>(getAttrs()) : 
nullptr0
;
529
42
  }
clang::CallableWhenAttr* clang::Decl::getAttr<clang::CallableWhenAttr>() const
Line
Count
Source
527
285
  template<typename T> T *getAttr() const {
528
285
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())271
:
nullptr14
;
529
285
  }
clang::ParamTypestateAttr* clang::Decl::getAttr<clang::ParamTypestateAttr>() const
Line
Count
Source
527
67
  template<typename T> T *getAttr() const {
528
67
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())16
:
nullptr51
;
529
67
  }
clang::ReturnTypestateAttr* clang::Decl::getAttr<clang::ReturnTypestateAttr>() const
Line
Count
Source
527
250
  template<typename T> T *getAttr() const {
528
250
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())34
:
nullptr216
;
529
250
  }
clang::SetTypestateAttr* clang::Decl::getAttr<clang::SetTypestateAttr>() const
Line
Count
Source
527
213
  template<typename T> T *getAttr() const {
528
213
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())200
:
nullptr13
;
529
213
  }
clang::CapabilityAttr* clang::Decl::getAttr<clang::CapabilityAttr>() const
Line
Count
Source
527
3.98k
  template<typename T> T *getAttr() const {
528
3.98k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.83k
:
nullptr152
;
529
3.98k
  }
clang::LockReturnedAttr* clang::Decl::getAttr<clang::LockReturnedAttr>() const
Line
Count
Source
527
360
  template<typename T> T *getAttr() const {
528
360
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())172
:
nullptr188
;
529
360
  }
clang::EnumExtensibilityAttr* clang::Decl::getAttr<clang::EnumExtensibilityAttr>() const
Line
Count
Source
527
105k
  template<typename T> T *getAttr() const {
528
105k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())5.03k
:
nullptr100k
;
529
105k
  }
clang::ExternalSourceSymbolAttr* clang::Decl::getAttr<clang::ExternalSourceSymbolAttr>() const
Line
Count
Source
527
59.6k
  template<typename T> T *getAttr() const {
528
59.6k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())646
:
nullptr59.0k
;
529
59.6k
  }
clang::ObjCMethodFamilyAttr* clang::Decl::getAttr<clang::ObjCMethodFamilyAttr>() const
Line
Count
Source
527
29.2k
  template<typename T> T *getAttr() const {
528
29.2k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())3.76k
:
nullptr25.4k
;
529
29.2k
  }
clang::ObjCRuntimeNameAttr* clang::Decl::getAttr<clang::ObjCRuntimeNameAttr>() const
Line
Count
Source
527
10.6k
  template<typename T> T *getAttr() const {
528
10.6k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())974
:
nullptr9.69k
;
529
10.6k
  }
clang::MSVtorDispAttr* clang::Decl::getAttr<clang::MSVtorDispAttr>() const
Line
Count
Source
527
1.24k
  template<typename T> T *getAttr() const {
528
1.24k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())139
:
nullptr1.10k
;
529
1.24k
  }
clang::MaxFieldAlignmentAttr* clang::Decl::getAttr<clang::MaxFieldAlignmentAttr>() const
Line
Count
Source
527
252k
  template<typename T> T *getAttr() const {
528
252k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())23.0k
:
nullptr229k
;
529
252k
  }
clang::LayoutVersionAttr* clang::Decl::getAttr<clang::LayoutVersionAttr>() const
Line
Count
Source
527
2.84k
  template<typename T> T *getAttr() const {
528
2.84k
    return hasAttrs() ? 
getSpecificAttr<T>(getAttrs())823
:
nullptr2.01k
;
529
2.84k
  }
530
531
628M
  template<typename T> bool hasAttr() const {
532
628M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())181M
;
533
628M
  }
bool clang::Decl::hasAttr<clang::DLLExportAttr>() const
Line
Count
Source
531
14.2M
  template<typename T> bool hasAttr() const {
532
14.2M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())5.17M
;
533
14.2M
  }
bool clang::Decl::hasAttr<clang::CUDADeviceAttr>() const
Line
Count
Source
531
3.15k
  template<typename T> bool hasAttr() const {
532
3.15k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.58k
;
533
3.15k
  }
bool clang::Decl::hasAttr<clang::CUDASharedAttr>() const
Line
Count
Source
531
10.9k
  template<typename T> bool hasAttr() const {
532
10.9k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.12k
;
533
10.9k
  }
bool clang::Decl::hasAttr<clang::CUDAGlobalAttr>() const
Line
Count
Source
531
5.29M
  template<typename T> bool hasAttr() const {
532
5.29M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())4.08M
;
533
5.29M
  }
bool clang::Decl::hasAttr<clang::NSConsumedAttr>() const
Line
Count
Source
531
26.9k
  template<typename T> bool hasAttr() const {
532
26.9k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.11k
;
533
26.9k
  }
bool clang::Decl::hasAttr<clang::PassObjectSizeAttr>() const
Line
Count
Source
531
15.3M
  template<typename T> bool hasAttr() const {
532
15.3M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())11.8k
;
533
15.3M
  }
bool clang::Decl::hasAttr<clang::AsmLabelAttr>() const
Line
Count
Source
531
4.11M
  template<typename T> bool hasAttr() const {
532
4.11M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.02M
;
533
4.11M
  }
bool clang::Decl::hasAttr<clang::ConstAttr>() const
Line
Count
Source
531
4.27M
  template<typename T> bool hasAttr() const {
532
4.27M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.46M
;
533
4.27M
  }
bool clang::Decl::hasAttr<clang::AlwaysInlineAttr>() const
Line
Count
Source
531
2.48M
  template<typename T> bool hasAttr() const {
532
2.48M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())556k
;
533
2.48M
  }
bool clang::Decl::hasAttr<clang::FinalAttr>() const
Line
Count
Source
531
8.79M
  template<typename T> bool hasAttr() const {
532
8.79M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.76M
;
533
8.79M
  }
bool clang::Decl::hasAttr<clang::StdCallAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())211
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::FastCallAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())209
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::RegCallAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())209
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::ThisCallAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())209
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::VectorCallAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())209
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::PascalAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())209
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::AArch64VectorPcsAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())209
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::IntelOclBiccAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())209
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::MSABIAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())209
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::SysVABIAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())207
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::PreserveMostAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())207
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::PreserveAllAttr>() const
Line
Count
Source
531
3.79k
  template<typename T> bool hasAttr() const {
532
3.79k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())207
;
533
3.79k
  }
bool clang::Decl::hasAttr<clang::NoEscapeAttr>() const
Line
Count
Source
531
12.0M
  template<typename T> bool hasAttr() const {
532
12.0M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())10.2k
;
533
12.0M
  }
bool clang::Decl::hasAttr<clang::NSReturnsRetainedAttr>() const
Line
Count
Source
531
35.4k
  template<typename T> bool hasAttr() const {
532
35.4k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())7.86k
;
533
35.4k
  }
bool clang::Decl::hasAttr<clang::ReturnsTwiceAttr>() const
Line
Count
Source
531
2.59M
  template<typename T> bool hasAttr() const {
532
2.59M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())747k
;
533
2.59M
  }
bool clang::Decl::hasAttr<clang::NoThrowAttr>() const
Line
Count
Source
531
4.29M
  template<typename T> bool hasAttr() const {
532
4.29M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.18M
;
533
4.29M
  }
bool clang::Decl::hasAttr<clang::NoReturnAttr>() const
Line
Count
Source
531
9.09M
  template<typename T> bool hasAttr() const {
532
9.09M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())3.46M
;
533
9.09M
  }
bool clang::Decl::hasAttr<clang::ColdAttr>() const
Line
Count
Source
531
2.20M
  template<typename T> bool hasAttr() const {
532
2.20M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())646k
;
533
2.20M
  }
bool clang::Decl::hasAttr<clang::NoDuplicateAttr>() const
Line
Count
Source
531
2.13M
  template<typename T> bool hasAttr() const {
532
2.13M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())643k
;
533
2.13M
  }
bool clang::Decl::hasAttr<clang::ConvergentAttr>() const
Line
Count
Source
531
1.75M
  template<typename T> bool hasAttr() const {
532
1.75M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())506k
;
533
1.75M
  }
bool clang::Decl::hasAttr<clang::SpeculativeLoadHardeningAttr>() const
Line
Count
Source
531
1.75M
  template<typename T> bool hasAttr() const {
532
1.75M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())506k
;
533
1.75M
  }
bool clang::Decl::hasAttr<clang::PureAttr>() const
Line
Count
Source
531
2.94M
  template<typename T> bool hasAttr() const {
532
2.94M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())844k
;
533
2.94M
  }
bool clang::Decl::hasAttr<clang::NoAliasAttr>() const
Line
Count
Source
531
1.74M
  template<typename T> bool hasAttr() const {
532
1.74M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())503k
;
533
1.74M
  }
bool clang::Decl::hasAttr<clang::RestrictAttr>() const
Line
Count
Source
531
1.75M
  template<typename T> bool hasAttr() const {
532
1.75M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())506k
;
533
1.75M
  }
bool clang::Decl::hasAttr<clang::ReturnsNonNullAttr>() const
Line
Count
Source
531
1.75M
  template<typename T> bool hasAttr() const {
532
1.75M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())506k
;
533
1.75M
  }
bool clang::Decl::hasAttr<clang::AnyX86NoCallerSavedRegistersAttr>() const
Line
Count
Source
531
1.75M
  template<typename T> bool hasAttr() const {
532
1.75M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())506k
;
533
1.75M
  }
bool clang::Decl::hasAttr<clang::AnyX86NoCfCheckAttr>() const
Line
Count
Source
531
1.75M
  template<typename T> bool hasAttr() const {
532
1.75M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())506k
;
533
1.75M
  }
bool clang::Decl::hasAttr<clang::OptimizeNoneAttr>() const
Line
Count
Source
531
2.59M
  template<typename T> bool hasAttr() const {
532
2.59M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())783k
;
533
2.59M
  }
bool clang::Decl::hasAttr<clang::NoSplitStackAttr>() const
Line
Count
Source
531
8
  template<typename T> bool hasAttr() const {
532
8
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())4
;
533
8
  }
bool clang::Decl::hasAttr<clang::OpenCLKernelAttr>() const
Line
Count
Source
531
12.3M
  template<typename T> bool hasAttr() const {
532
12.3M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())7.06M
;
533
12.3M
  }
bool clang::Decl::hasAttr<clang::DisableTailCallsAttr>() const
Line
Count
Source
531
569k
  template<typename T> bool hasAttr() const {
532
569k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())156k
;
533
569k
  }
bool clang::Decl::hasAttr<clang::AnyX86InterruptAttr>() const
Line
Count
Source
531
4.40M
  template<typename T> bool hasAttr() const {
532
4.40M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.28M
;
533
4.40M
  }
bool clang::Decl::hasAttr<clang::NakedAttr>() const
Line
Count
Source
531
9.79M
  template<typename T> bool hasAttr() const {
532
9.79M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())5.25M
;
533
9.79M
  }
bool clang::Decl::hasAttr<clang::FlattenAttr>() const
Line
Count
Source
531
1.18M
  template<typename T> bool hasAttr() const {
532
1.18M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())196k
;
533
1.18M
  }
bool clang::Decl::hasAttr<clang::NoInlineAttr>() const
Line
Count
Source
531
383k
  template<typename T> bool hasAttr() const {
532
383k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())136k
;
533
383k
  }
bool clang::Decl::hasAttr<clang::NotTailCalledAttr>() const
Line
Count
Source
531
1.14M
  template<typename T> bool hasAttr() const {
532
1.14M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())334k
;
533
1.14M
  }
bool clang::Decl::hasAttr<clang::AlignedAttr>() const
Line
Count
Source
531
667k
  template<typename T> bool hasAttr() const {
532
667k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())155k
;
533
667k
  }
bool clang::Decl::hasAttr<clang::DLLImportAttr>() const
Line
Count
Source
531
19.7M
  template<typename T> bool hasAttr() const {
532
19.7M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())6.31M
;
533
19.7M
  }
bool clang::Decl::hasAttr<clang::NoDebugAttr>() const
Line
Count
Source
531
450k
  template<typename T> bool hasAttr() const {
532
450k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())140k
;
533
450k
  }
bool clang::Decl::hasAttr<clang::ArtificialAttr>() const
Line
Count
Source
531
203k
  template<typename T> bool hasAttr() const {
532
203k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())63.5k
;
533
203k
  }
bool clang::Decl::hasAttr<clang::BlocksAttr>() const
Line
Count
Source
531
28.1M
  template<typename T> bool hasAttr() const {
532
28.1M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())303k
;
533
28.1M
  }
bool clang::Decl::hasAttr<clang::AnnotateAttr>() const
Line
Count
Source
531
2.65M
  template<typename T> bool hasAttr() const {
532
2.65M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())153k
;
533
2.65M
  }
bool clang::Decl::hasAttr<clang::UsedAttr>() const
Line
Count
Source
531
35.9M
  template<typename T> bool hasAttr() const {
532
35.9M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())7.62M
;
533
35.9M
  }
bool clang::Decl::hasAttr<clang::ObjCPreciseLifetimeAttr>() const
Line
Count
Source
531
21.9M
  template<typename T> bool hasAttr() const {
532
21.9M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())838k
;
533
21.9M
  }
bool clang::Decl::hasAttr<clang::OMPThreadPrivateDeclAttr>() const
Line
Count
Source
531
1.08M
  template<typename T> bool hasAttr() const {
532
1.08M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())32.5k
;
533
1.08M
  }
bool clang::Decl::hasAttr<clang::CUDAConstantAttr>() const
Line
Count
Source
531
5.07k
  template<typename T> bool hasAttr() const {
532
5.07k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())746
;
533
5.07k
  }
bool clang::Decl::hasAttr<clang::SelectAnyAttr>() const
Line
Count
Source
531
343k
  template<typename T> bool hasAttr() const {
532
343k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())47.1k
;
533
343k
  }
bool clang::Decl::hasAttr<clang::WeakRefAttr>() const
Line
Count
Source
531
21.7M
  template<typename T> bool hasAttr() const {
532
21.7M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())9.04M
;
533
21.7M
  }
bool clang::Decl::hasAttr<clang::MayAliasAttr>() const
Line
Count
Source
531
6.00M
  template<typename T> bool hasAttr() const {
532
6.00M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())108k
;
533
6.00M
  }
bool clang::Decl::hasAttr<clang::TargetAttr>() const
Line
Count
Source
531
10.3M
  template<typename T> bool hasAttr() const {
532
10.3M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())4.23M
;
533
10.3M
  }
bool clang::Decl::hasAttr<clang::NSConsumesSelfAttr>() const
Line
Count
Source
531
8.55k
  template<typename T> bool hasAttr() const {
532
8.55k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.03k
;
533
8.55k
  }
bool clang::Decl::hasAttr<clang::ObjCReturnsInnerPointerAttr>() const
Line
Count
Source
531
22.3k
  template<typename T> bool hasAttr() const {
532
22.3k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())4.33k
;
533
22.3k
  }
bool clang::Decl::hasAttr<clang::ObjCRuntimeVisibleAttr>() const
Line
Count
Source
531
2.47k
  template<typename T> bool hasAttr() const {
532
2.47k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())190
;
533
2.47k
  }
bool clang::Decl::hasAttr<clang::ObjCExceptionAttr>() const
Line
Count
Source
531
952
  template<typename T> bool hasAttr() const {
532
952
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())180
;
533
952
  }
bool clang::Decl::hasAttr<clang::OMPCaptureNoInitAttr>() const
Line
Count
Source
531
3.64k
  template<typename T> bool hasAttr() const {
532
3.64k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())170
;
533
3.64k
  }
bool clang::Decl::hasAttr<clang::CUDAHostAttr>() const
Line
Count
Source
531
1.58k
  template<typename T> bool hasAttr() const {
532
1.58k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.15k
;
533
1.58k
  }
bool clang::Decl::hasAttr<clang::LTOVisibilityPublicAttr>() const
Line
Count
Source
531
192
  template<typename T> bool hasAttr() const {
532
192
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())14
;
533
192
  }
bool clang::Decl::hasAttr<clang::UuidAttr>() const
Line
Count
Source
531
188
  template<typename T> bool hasAttr() const {
532
188
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())10
;
533
188
  }
bool clang::Decl::hasAttr<clang::NoInstrumentFunctionAttr>() const
Line
Count
Source
531
132
  template<typename T> bool hasAttr() const {
532
132
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())27
;
533
132
  }
bool clang::Decl::hasAttr<clang::CPUSpecificAttr>() const
Line
Count
Source
531
9.66M
  template<typename T> bool hasAttr() const {
532
9.66M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())3.57M
;
533
9.66M
  }
bool clang::Decl::hasAttr<clang::NoCommonAttr>() const
Line
Count
Source
531
17.4k
  template<typename T> bool hasAttr() const {
532
17.4k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())905
;
533
17.4k
  }
bool clang::Decl::hasAttr<clang::CommonAttr>() const
Line
Count
Source
531
82
  template<typename T> bool hasAttr() const {
532
82
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())63
;
533
82
  }
bool clang::Decl::hasAttr<clang::SectionAttr>() const
Line
Count
Source
531
8.19M
  template<typename T> bool hasAttr() const {
532
8.19M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())296k
;
533
8.19M
  }
bool clang::Decl::hasAttr<clang::PragmaClangBSSSectionAttr>() const
Line
Count
Source
531
13.3k
  template<typename T> bool hasAttr() const {
532
13.3k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())435
;
533
13.3k
  }
bool clang::Decl::hasAttr<clang::PragmaClangDataSectionAttr>() const
Line
Count
Source
531
13.3k
  template<typename T> bool hasAttr() const {
532
13.3k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())430
;
533
13.3k
  }
bool clang::Decl::hasAttr<clang::PragmaClangRodataSectionAttr>() const
Line
Count
Source
531
13.3k
  template<typename T> bool hasAttr() const {
532
13.3k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())430
;
533
13.3k
  }
bool clang::Decl::hasAttr<clang::WeakImportAttr>() const
Line
Count
Source
531
105k
  template<typename T> bool hasAttr() const {
532
105k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.65k
;
533
105k
  }
bool clang::Decl::hasAttr<clang::IFuncAttr>() const
Line
Count
Source
531
32.1M
  template<typename T> bool hasAttr() const {
532
32.1M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())7.98M
;
533
32.1M
  }
bool clang::Decl::hasAttr<clang::NoStackProtectorAttr>() const
Line
Count
Source
531
457k
  template<typename T> bool hasAttr() const {
532
457k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())139k
;
533
457k
  }
bool clang::Decl::hasAttr<clang::MinSizeAttr>() const
Line
Count
Source
531
915k
  template<typename T> bool hasAttr() const {
532
915k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())279k
;
533
915k
  }
bool clang::Decl::hasAttr<clang::WeakAttr>() const
Line
Count
Source
531
2.19M
  template<typename T> bool hasAttr() const {
532
2.19M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())419k
;
533
2.19M
  }
bool clang::Decl::hasAttr<clang::OMPDeclareSimdDeclAttr>() const
Line
Count
Source
531
21.0k
  template<typename T> bool hasAttr() const {
532
21.0k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())141
;
533
21.0k
  }
bool clang::Decl::hasAttr<clang::AliasAttr>() const
Line
Count
Source
531
39.8M
  template<typename T> bool hasAttr() const {
532
39.8M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())10.7M
;
533
39.8M
  }
bool clang::Decl::hasAttr<clang::CPUDispatchAttr>() const
Line
Count
Source
531
16.0M
  template<typename T> bool hasAttr() const {
532
16.0M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())5.94M
;
533
16.0M
  }
bool clang::Decl::hasAttr<clang::MSInheritanceAttr>() const
Line
Count
Source
531
5.25k
  template<typename T> bool hasAttr() const {
532
5.25k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())4.87k
;
533
5.25k
  }
bool clang::Decl::hasAttr<clang::MSNoVTableAttr>() const
Line
Count
Source
531
797
  template<typename T> bool hasAttr() const {
532
797
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())170
;
533
797
  }
bool clang::Decl::hasAttr<clang::TransparentUnionAttr>() const
Line
Count
Source
531
255
  template<typename T> bool hasAttr() const {
532
255
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())144
;
533
255
  }
bool clang::Decl::hasAttr<clang::PackedAttr>() const
Line
Count
Source
531
1.35M
  template<typename T> bool hasAttr() const {
532
1.35M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())34.8k
;
533
1.35M
  }
bool clang::Decl::hasAttr<clang::MipsLongCallAttr>() const
Line
Count
Source
531
815
  template<typename T> bool hasAttr() const {
532
815
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())137
;
533
815
  }
bool clang::Decl::hasAttr<clang::MipsShortCallAttr>() const
Line
Count
Source
531
809
  template<typename T> bool hasAttr() const {
532
809
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())131
;
533
809
  }
bool clang::Decl::hasAttr<clang::Mips16Attr>() const
Line
Count
Source
531
382
  template<typename T> bool hasAttr() const {
532
382
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())62
;
533
382
  }
bool clang::Decl::hasAttr<clang::NoMips16Attr>() const
Line
Count
Source
531
381
  template<typename T> bool hasAttr() const {
532
381
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())61
;
533
381
  }
bool clang::Decl::hasAttr<clang::MicroMipsAttr>() const
Line
Count
Source
531
382
  template<typename T> bool hasAttr() const {
532
382
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())62
;
533
382
  }
bool clang::Decl::hasAttr<clang::NoMicroMipsAttr>() const
Line
Count
Source
531
381
  template<typename T> bool hasAttr() const {
532
381
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())61
;
533
381
  }
bool clang::Decl::hasAttr<clang::X86ForceAlignArgPointerAttr>() const
Line
Count
Source
531
189k
  template<typename T> bool hasAttr() const {
532
189k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())56.2k
;
533
189k
  }
bool clang::Decl::hasAttr<clang::CFAuditedTransferAttr>() const
Line
Count
Source
531
16.1k
  template<typename T> bool hasAttr() const {
532
16.1k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())3.87k
;
533
16.1k
  }
bool clang::Decl::hasAttr<clang::CFReturnsRetainedAttr>() const
Line
Count
Source
531
2.56k
  template<typename T> bool hasAttr() const {
532
2.56k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())174
;
533
2.56k
  }
bool clang::Decl::hasAttr<clang::CFReturnsNotRetainedAttr>() const
Line
Count
Source
531
2.54k
  template<typename T> bool hasAttr() const {
532
2.54k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())128
;
533
2.54k
  }
bool clang::Decl::hasAttr<clang::NSReturnsNotRetainedAttr>() const
Line
Count
Source
531
54.8k
  template<typename T> bool hasAttr() const {
532
54.8k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())10.4k
;
533
54.8k
  }
bool clang::Decl::hasAttr<clang::NSReturnsAutoreleasedAttr>() const
Line
Count
Source
531
1.00k
  template<typename T> bool hasAttr() const {
532
1.00k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())42
;
533
1.00k
  }
bool clang::Decl::hasAttr<clang::CFConsumedAttr>() const
Line
Count
Source
531
1.59k
  template<typename T> bool hasAttr() const {
532
1.59k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())74
;
533
1.59k
  }
bool clang::Decl::hasAttr<clang::IBOutletAttr>() const
Line
Count
Source
531
703
  template<typename T> bool hasAttr() const {
532
703
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())32
;
533
703
  }
bool clang::Decl::hasAttr<clang::UnusedAttr>() const
Line
Count
Source
531
28.3M
  template<typename T> bool hasAttr() const {
532
28.3M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())4.60M
;
533
28.3M
  }
bool clang::Decl::hasAttr<clang::OverrideAttr>() const
Line
Count
Source
531
10.2M
  template<typename T> bool hasAttr() const {
532
10.2M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.58M
;
533
10.2M
  }
bool clang::Decl::hasAttr<clang::ReinitializesAttr>() const
Line
Count
Source
531
810
  template<typename T> bool hasAttr() const {
532
810
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())4
;
533
810
  }
bool clang::Decl::hasAttr<clang::AnalyzerNoReturnAttr>() const
Line
Count
Source
531
903k
  template<typename T> bool hasAttr() const {
532
903k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())242k
;
533
903k
  }
bool clang::Decl::hasAttr<clang::NonNullAttr>() const
Line
Count
Source
531
6.35M
  template<typename T> bool hasAttr() const {
532
6.35M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())26.1k
;
533
6.35M
  }
bool clang::Decl::hasAttr<clang::IBOutletCollectionAttr>() const
Line
Count
Source
531
1.08k
  template<typename T> bool hasAttr() const {
532
1.08k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())81
;
533
1.08k
  }
bool clang::Decl::hasAttr<clang::CleanupAttr>() const
Line
Count
Source
531
3.85M
  template<typename T> bool hasAttr() const {
532
3.85M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())49.2k
;
533
3.85M
  }
bool clang::Decl::hasAttr<clang::OSConsumedAttr>() const
Line
Count
Source
531
318
  template<typename T> bool hasAttr() const {
532
318
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())6
;
533
318
  }
bool clang::Decl::hasAttr<clang::OSReturnsNotRetainedAttr>() const
Line
Count
Source
531
68
  template<typename T> bool hasAttr() const {
532
68
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())9
;
533
68
  }
bool clang::Decl::hasAttr<clang::OSReturnsRetainedAttr>() const
Line
Count
Source
531
31
  template<typename T> bool hasAttr() const {
532
31
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())9
;
533
31
  }
bool clang::Decl::hasAttr<clang::OSConsumesThisAttr>() const
Line
Count
Source
531
140
  template<typename T> bool hasAttr() const {
532
140
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())9
;
533
140
  }
bool clang::Decl::hasAttr<clang::OverloadableAttr>() const
Line
Count
Source
531
29.0M
  template<typename T> bool hasAttr() const {
532
29.0M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())19.2M
;
533
29.0M
  }
bool clang::Decl::hasAttr<clang::UnavailableAttr>() const
Line
Count
Source
531
848k
  template<typename T> bool hasAttr() const {
532
848k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.07k
;
533
848k
  }
bool clang::Decl::hasAttr<clang::ExcludeFromExplicitInstantiationAttr>() const
Line
Count
Source
531
363k
  template<typename T> bool hasAttr() const {
532
363k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())194k
;
533
363k
  }
bool clang::Decl::hasAttr<clang::CFUnknownTransferAttr>() const
Line
Count
Source
531
13.3k
  template<typename T> bool hasAttr() const {
532
13.3k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())3.59k
;
533
13.3k
  }
bool clang::Decl::hasAttr<clang::CUDAInvalidTargetAttr>() const
Line
Count
Source
531
33.3k
  template<typename T> bool hasAttr() const {
532
33.3k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())29.4k
;
533
33.3k
  }
bool clang::Decl::hasAttr<clang::WarnUnusedAttr>() const
Line
Count
Source
531
38.2k
  template<typename T> bool hasAttr() const {
532
38.2k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())233
;
533
38.2k
  }
bool clang::Decl::hasAttr<clang::CodeSegAttr>() const
Line
Count
Source
531
7.23M
  template<typename T> bool hasAttr() const {
532
7.23M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())110k
;
533
7.23M
  }
bool clang::Decl::hasAttr<clang::CarriesDependencyAttr>() const
Line
Count
Source
531
5
  template<typename T> bool hasAttr() const {
532
5
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2
;
533
5
  }
bool clang::Decl::hasAttr<clang::GNUInlineAttr>() const
Line
Count
Source
531
6.89M
  template<typename T> bool hasAttr() const {
532
6.89M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.74M
;
533
6.89M
  }
bool clang::Decl::hasAttr<clang::InternalLinkageAttr>() const
Line
Count
Source
531
87.4M
  template<typename T> bool hasAttr() const {
532
87.4M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())34.0M
;
533
87.4M
  }
bool clang::Decl::hasAttr<clang::CXX11NoReturnAttr>() const
Line
Count
Source
531
7.33M
  template<typename T> bool hasAttr() const {
532
7.33M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.95M
;
533
7.33M
  }
bool clang::Decl::hasAttr<clang::OMPDeclareTargetDeclAttr>() const
Line
Count
Source
531
8.55k
  template<typename T> bool hasAttr() const {
532
8.55k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())589
;
533
8.55k
  }
bool clang::Decl::hasAttr<clang::ConstructorAttr>() const
Line
Count
Source
531
4.78M
  template<typename T> bool hasAttr() const {
532
4.78M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.92M
;
533
4.78M
  }
bool clang::Decl::hasAttr<clang::DestructorAttr>() const
Line
Count
Source
531
4.78M
  template<typename T> bool hasAttr() const {
532
4.78M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.92M
;
533
4.78M
  }
bool clang::Decl::hasAttr<clang::RequireConstantInitAttr>() const
Line
Count
Source
531
329k
  template<typename T> bool hasAttr() const {
532
329k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())17.4k
;
533
329k
  }
bool clang::Decl::hasAttr<clang::DLLExportStaticLocalAttr>() const
Line
Count
Source
531
10.9k
  template<typename T> bool hasAttr() const {
532
10.9k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.58k
;
533
10.9k
  }
bool clang::Decl::hasAttr<clang::DLLImportStaticLocalAttr>() const
Line
Count
Source
531
10.9k
  template<typename T> bool hasAttr() const {
532
10.9k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.58k
;
533
10.9k
  }
bool clang::Decl::hasAttr<clang::TypeTagForDatatypeAttr>() const
Line
Count
Source
531
3.35M
  template<typename T> bool hasAttr() const {
532
3.35M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())49.3k
;
533
3.35M
  }
bool clang::Decl::hasAttr<clang::FormatAttr>() const
Line
Count
Source
531
60.5k
  template<typename T> bool hasAttr() const {
532
60.5k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())35.8k
;
533
60.5k
  }
bool clang::Decl::hasAttr<clang::FormatArgAttr>() const
Line
Count
Source
531
16
  template<typename T> bool hasAttr() const {
532
16
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())15
;
533
16
  }
bool clang::Decl::hasAttr<clang::OpenCLAccessAttr>() const
Line
Count
Source
531
7.25k
  template<typename T> bool hasAttr() const {
532
7.25k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())9
;
533
7.25k
  }
bool clang::Decl::hasAttr<clang::CapabilityAttr>() const
Line
Count
Source
531
3.00k
  template<typename T> bool hasAttr() const {
532
3.00k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.82k
;
533
3.00k
  }
bool clang::Decl::hasAttr<clang::ScopedLockableAttr>() const
Line
Count
Source
531
331
  template<typename T> bool hasAttr() const {
532
331
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())284
;
533
331
  }
bool clang::Decl::hasAttr<clang::ConsumableAttr>() const
Line
Count
Source
531
247
  template<typename T> bool hasAttr() const {
532
247
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())239
;
533
247
  }
bool clang::Decl::hasAttr<clang::AvailabilityAttr>() const
Line
Count
Source
531
66
  template<typename T> bool hasAttr() const {
532
66
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())11
;
533
66
  }
bool clang::Decl::hasAttr<clang::TrivialABIAttr>() const
Line
Count
Source
531
5.32M
  template<typename T> bool hasAttr() const {
532
5.32M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())723k
;
533
5.32M
  }
bool clang::Decl::hasAttr<clang::VisibilityAttr>() const
Line
Count
Source
531
325k
  template<typename T> bool hasAttr() const {
532
325k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())126k
;
533
325k
  }
bool clang::Decl::hasAttr<clang::ObjCExplicitProtocolImplAttr>() const
Line
Count
Source
531
1.32k
  template<typename T> bool hasAttr() const {
532
1.32k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())36
;
533
1.32k
  }
bool clang::Decl::hasAttr<clang::ObjCRequiresSuperAttr>() const
Line
Count
Source
531
4.71k
  template<typename T> bool hasAttr() const {
532
4.71k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())552
;
533
4.71k
  }
bool clang::Decl::hasAttr<clang::DeprecatedAttr>() const
Line
Count
Source
531
53
  template<typename T> bool hasAttr() const {
532
53
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())11
;
533
53
  }
bool clang::Decl::hasAttr<clang::ObjCRootClassAttr>() const
Line
Count
Source
531
4.02k
  template<typename T> bool hasAttr() const {
532
4.02k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())132
;
533
4.02k
  }
bool clang::Decl::hasAttr<clang::ObjCSubclassingRestrictedAttr>() const
Line
Count
Source
531
14.1k
  template<typename T> bool hasAttr() const {
532
14.1k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())4.24k
;
533
14.1k
  }
bool clang::Decl::hasAttr<clang::ARMInterruptAttr>() const
Line
Count
Source
531
3.57M
  template<typename T> bool hasAttr() const {
532
3.57M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.71M
;
533
3.57M
  }
bool clang::Decl::hasAttr<clang::LifetimeBoundAttr>() const
Line
Count
Source
531
2.64M
  template<typename T> bool hasAttr() const {
532
2.64M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())64
;
533
2.64M
  }
bool clang::Decl::hasAttr<clang::ObjCNSObjectAttr>() const
Line
Count
Source
531
1.22M
  template<typename T> bool hasAttr() const {
532
1.22M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())70.9k
;
533
1.22M
  }
bool clang::Decl::hasAttr<clang::EnableIfAttr>() const
Line
Count
Source
531
2.05M
  template<typename T> bool hasAttr() const {
532
2.05M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1.08M
;
533
2.05M
  }
bool clang::Decl::hasAttr<clang::FlagEnumAttr>() const
Line
Count
Source
531
103k
  template<typename T> bool hasAttr() const {
532
103k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.25k
;
533
103k
  }
bool clang::Decl::hasAttr<clang::ConsumableSetOnReadAttr>() const
Line
Count
Source
531
18
  template<typename T> bool hasAttr() const {
532
18
    return hasAttrs() && hasSpecificAttr<T>(getAttrs());
533
18
  }
bool clang::Decl::hasAttr<clang::TestTypestateAttr>() const
Line
Count
Source
531
187
  template<typename T> bool hasAttr() const {
532
187
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())174
;
533
187
  }
bool clang::Decl::hasAttr<clang::ConsumableAutoCastAttr>() const
Line
Count
Source
531
4
  template<typename T> bool hasAttr() const {
532
4
    return hasAttrs() && hasSpecificAttr<T>(getAttrs());
533
4
  }
bool clang::Decl::hasAttr<clang::NoThreadSafetyAnalysisAttr>() const
Line
Count
Source
531
7.76k
  template<typename T> bool hasAttr() const {
532
7.76k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())4.58k
;
533
7.76k
  }
bool clang::Decl::hasAttr<clang::PtGuardedVarAttr>() const
Line
Count
Source
531
442
  template<typename T> bool hasAttr() const {
532
442
    return hasAttrs() && hasSpecificAttr<T>(getAttrs());
533
442
  }
bool clang::Decl::hasAttr<clang::GuardedVarAttr>() const
Line
Count
Source
531
2.41k
  template<typename T> bool hasAttr() const {
532
2.41k
    return hasAttrs() && hasSpecificAttr<T>(getAttrs());
533
2.41k
  }
bool clang::Decl::hasAttr<clang::TypeVisibilityAttr>() const
Line
Count
Source
531
206k
  template<typename T> bool hasAttr() const {
532
206k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())197k
;
533
206k
  }
bool clang::Decl::hasAttr<clang::ThreadAttr>() const
Line
Count
Source
531
4.85M
  template<typename T> bool hasAttr() const {
532
4.85M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())132k
;
533
4.85M
  }
bool clang::Decl::hasAttr<clang::NoDestroyAttr>() const
Line
Count
Source
531
11.7k
  template<typename T> bool hasAttr() const {
532
11.7k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.15k
;
533
11.7k
  }
bool clang::Decl::hasAttr<clang::AlwaysDestroyAttr>() const
Line
Count
Source
531
24
  template<typename T> bool hasAttr() const {
532
24
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())14
;
533
24
  }
bool clang::Decl::hasAttr<clang::C11NoReturnAttr>() const
Line
Count
Source
531
7.33M
  template<typename T> bool hasAttr() const {
532
7.33M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())2.95M
;
533
7.33M
  }
Unexecuted instantiation: bool clang::Decl::hasAttr<clang::CapturedRecordAttr>() const
bool clang::Decl::hasAttr<clang::MSStructAttr>() const
Line
Count
Source
531
2.71M
  template<typename T> bool hasAttr() const {
532
2.71M
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())365k
;
533
2.71M
  }
bool clang::Decl::hasAttr<clang::ArcWeakrefUnavailableAttr>() const
Line
Count
Source
531
561
  template<typename T> bool hasAttr() const {
532
561
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())81
;
533
561
  }
bool clang::Decl::hasAttr<clang::ObjCRequiresPropertyDefsAttr>() const
Line
Count
Source
531
15.3k
  template<typename T> bool hasAttr() const {
532
15.3k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())733
;
533
15.3k
  }
bool clang::Decl::hasAttr<clang::ObjCDesignatedInitializerAttr>() const
Line
Count
Source
531
88
  template<typename T> bool hasAttr() const {
532
88
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())76
;
533
88
  }
bool clang::Decl::hasAttr<clang::WarnUnusedResultAttr>() const
Line
Count
Source
531
13.8k
  template<typename T> bool hasAttr() const {
532
13.8k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())598
;
533
13.8k
  }
bool clang::Decl::hasAttr<clang::EmptyBasesAttr>() const
Line
Count
Source
531
2.85k
  template<typename T> bool hasAttr() const {
532
2.85k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())839
;
533
2.85k
  }
bool clang::Decl::hasAttr<clang::AlignMac68kAttr>() const
Line
Count
Source
531
248k
  template<typename T> bool hasAttr() const {
532
248k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())22.0k
;
533
248k
  }
bool clang::Decl::hasAttr<clang::ObjCBoxableAttr>() const
Line
Count
Source
531
141
  template<typename T> bool hasAttr() const {
532
141
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())135
;
533
141
  }
bool clang::Decl::hasAttr<clang::ObjCIndependentClassAttr>() const
Line
Count
Source
531
2.34k
  template<typename T> bool hasAttr() const {
532
2.34k
    return hasAttrs() && 
hasSpecificAttr<T>(getAttrs())1
;
533
2.34k
  }
534
535
  /// getMaxAlignment - return the maximum alignment specified by attributes
536
  /// on this decl, 0 if there are none.
537
  unsigned getMaxAlignment() const;
538
539
  /// setInvalidDecl - Indicates the Decl had a semantic error. This
540
  /// allows for graceful error recovery.
541
  void setInvalidDecl(bool Invalid = true);
542
430M
  bool isInvalidDecl() const { return (bool) InvalidDecl; }
543
544
  /// isImplicit - Indicates whether the declaration was implicitly
545
  /// generated by the implementation. If false, this declaration
546
  /// was written explicitly in the source code.
547
49.3M
  bool isImplicit() const { return Implicit; }
548
10.8M
  void setImplicit(bool I = true) { Implicit = I; }
549
550
  /// Whether *any* (re-)declaration of the entity was used, meaning that
551
  /// a definition is required.
552
  ///
553
  /// \param CheckUsedAttr When true, also consider the "used" attribute
554
  /// (in addition to the "used" bit set by \c setUsed()) when determining
555
  /// whether the function is used.
556
  bool isUsed(bool CheckUsedAttr = true) const;
557
558
  /// Set whether the declaration is used, in the sense of odr-use.
559
  ///
560
  /// This should only be used immediately after creating a declaration.
561
  /// It intentionally doesn't notify any listeners.
562
6.94M
  void setIsUsed() { getCanonicalDecl()->Used = true; }
563
564
  /// Mark the declaration used, in the sense of odr-use.
565
  ///
566
  /// This notifies any mutation listeners in addition to setting a bit
567
  /// indicating the declaration is used.
568
  void markUsed(ASTContext &C);
569
570
  /// Whether any declaration of this entity was referenced.
571
  bool isReferenced() const;
572
573
  /// Whether this declaration was referenced. This should not be relied
574
  /// upon for anything other than debugging.
575
7.43k
  bool isThisDeclarationReferenced() const { return Referenced; }
576
577
56.4M
  void setReferenced(bool R = true) { Referenced = R; }
578
579
  /// Whether this declaration is a top-level declaration (function,
580
  /// global variable, etc.) that is lexically inside an objc container
581
  /// definition.
582
625k
  bool isTopLevelDeclInObjCContainer() const {
583
625k
    return TopLevelDeclInObjCContainer;
584
625k
  }
585
586
252k
  void setTopLevelDeclInObjCContainer(bool V = true) {
587
252k
    TopLevelDeclInObjCContainer = V;
588
252k
  }
589
590
  /// Looks on this and related declarations for an applicable
591
  /// external source symbol attribute.
592
  ExternalSourceSymbolAttr *getExternalSourceSymbolAttr() const;
593
594
  /// Whether this declaration was marked as being private to the
595
  /// module in which it was defined.
596
751k
  bool isModulePrivate() const {
597
751k
    return getModuleOwnershipKind() == ModuleOwnershipKind::ModulePrivate;
598
751k
  }
599
600
  /// Whether this declaration is exported (by virtue of being lexically
601
  /// within an ExportDecl or by being a NamespaceDecl).
602
  bool isExported() const;
603
604
  /// Return true if this declaration has an attribute which acts as
605
  /// definition of the entity, such as 'alias' or 'ifunc'.
606
  bool hasDefiningAttr() const;
607
608
  /// Return this declaration's defining attribute if it has one.
609
  const Attr *getDefiningAttr() const;
610
611
protected:
612
  /// Specify that this declaration was marked as being private
613
  /// to the module in which it was defined.
614
39
  void setModulePrivate() {
615
39
    // The module-private specifier has no effect on unowned declarations.
616
39
    // FIXME: We should track this in some way for source fidelity.
617
39
    if (getModuleOwnershipKind() == ModuleOwnershipKind::Unowned)
618
19
      return;
619
20
    setModuleOwnershipKind(ModuleOwnershipKind::ModulePrivate);
620
20
  }
621
622
  /// Set the owning module ID.
623
40.0k
  void setOwningModuleID(unsigned ID) {
624
40.0k
    assert(isFromASTFile() && "Only works on a deserialized declaration");
625
40.0k
    *((unsigned*)this - 2) = ID;
626
40.0k
  }
627
628
public:
629
  /// Determine the availability of the given declaration.
630
  ///
631
  /// This routine will determine the most restrictive availability of
632
  /// the given declaration (e.g., preferring 'unavailable' to
633
  /// 'deprecated').
634
  ///
635
  /// \param Message If non-NULL and the result is not \c
636
  /// AR_Available, will be set to a (possibly empty) message
637
  /// describing why the declaration has not been introduced, is
638
  /// deprecated, or is unavailable.
639
  ///
640
  /// \param EnclosingVersion The version to compare with. If empty, assume the
641
  /// deployment target version.
642
  ///
643
  /// \param RealizedPlatform If non-NULL and the availability result is found
644
  /// in an available attribute it will set to the platform which is written in
645
  /// the available attribute.
646
  AvailabilityResult
647
  getAvailability(std::string *Message = nullptr,
648
                  VersionTuple EnclosingVersion = VersionTuple(),
649
                  StringRef *RealizedPlatform = nullptr) const;
650
651
  /// Retrieve the version of the target platform in which this
652
  /// declaration was introduced.
653
  ///
654
  /// \returns An empty version tuple if this declaration has no 'introduced'
655
  /// availability attributes, or the version tuple that's specified in the
656
  /// attribute otherwise.
657
  VersionTuple getVersionIntroduced() const;
658
659
  /// Determine whether this declaration is marked 'deprecated'.
660
  ///
661
  /// \param Message If non-NULL and the declaration is deprecated,
662
  /// this will be set to the message describing why the declaration
663
  /// was deprecated (which may be empty).
664
54.2k
  bool isDeprecated(std::string *Message = nullptr) const {
665
54.2k
    return getAvailability(Message) == AR_Deprecated;
666
54.2k
  }
667
668
  /// Determine whether this declaration is marked 'unavailable'.
669
  ///
670
  /// \param Message If non-NULL and the declaration is unavailable,
671
  /// this will be set to the message describing why the declaration
672
  /// was made unavailable (which may be empty).
673
2.78M
  bool isUnavailable(std::string *Message = nullptr) const {
674
2.78M
    return getAvailability(Message) == AR_Unavailable;
675
2.78M
  }
676
677
  /// Determine whether this is a weak-imported symbol.
678
  ///
679
  /// Weak-imported symbols are typically marked with the
680
  /// 'weak_import' attribute, but may also be marked with an
681
  /// 'availability' attribute where we're targing a platform prior to
682
  /// the introduction of this feature.
683
  bool isWeakImported() const;
684
685
  /// Determines whether this symbol can be weak-imported,
686
  /// e.g., whether it would be well-formed to add the weak_import
687
  /// attribute.
688
  ///
689
  /// \param IsDefinition Set to \c true to indicate that this
690
  /// declaration cannot be weak-imported because it has a definition.
691
  bool canBeWeakImported(bool &IsDefinition) const;
692
693
  /// Determine whether this declaration came from an AST file (such as
694
  /// a precompiled header or module) rather than having been parsed.
695
142M
  bool isFromASTFile() const { return FromASTFile; }
696
697
  /// Retrieve the global declaration ID associated with this
698
  /// declaration, which specifies where this Decl was loaded from.
699
44.0k
  unsigned getGlobalID() const {
700
44.0k
    if (isFromASTFile())
701
44.0k
      return *((const unsigned*)this - 1);
702
0
    return 0;
703
0
  }
704
705
  /// Retrieve the global ID of the module that owns this particular
706
  /// declaration.
707
57.1k
  unsigned getOwningModuleID() const {
708
57.1k
    if (isFromASTFile())
709
57.1k
      return *((const unsigned*)this - 2);
710
0
    return 0;
711
0
  }
712
713
private:
714
  Module *getOwningModuleSlow() const;
715
716
protected:
717
  bool hasLocalOwningModuleStorage() const;
718
719
public:
720
  /// Get the imported owning module, if this decl is from an imported
721
  /// (non-local) module.
722
206k
  Module *getImportedOwningModule() const {
723
206k
    if (!isFromASTFile() || 
!hasOwningModule()206k
)
724
168k
      return nullptr;
725
38.2k
726
38.2k
    return getOwningModuleSlow();
727
38.2k
  }
728
729
  /// Get the local owning module, if known. Returns nullptr if owner is
730
  /// not yet known or declaration is not from a module.
731
29.3M
  Module *getLocalOwningModule() const {
732
29.3M
    if (isFromASTFile() || !hasOwningModule())
733
28.6M
      return nullptr;
734
682k
735
682k
    assert(hasLocalOwningModuleStorage() &&
736
682k
           "owned local decl but no local module storage");
737
682k
    return reinterpret_cast<Module *const *>(this)[-1];
738
682k
  }
739
6.12k
  void setLocalOwningModule(Module *M) {
740
6.12k
    assert(!isFromASTFile() && hasOwningModule() &&
741
6.12k
           hasLocalOwningModuleStorage() &&
742
6.12k
           "should not have a cached owning module");
743
6.12k
    reinterpret_cast<Module **>(this)[-1] = M;
744
6.12k
  }
745
746
  /// Is this declaration owned by some module?
747
30.2M
  bool hasOwningModule() const {
748
30.2M
    return getModuleOwnershipKind() != ModuleOwnershipKind::Unowned;
749
30.2M
  }
750
751
  /// Get the module that owns this declaration (for visibility purposes).
752
29.4M
  Module *getOwningModule() const {
753
29.4M
    return isFromASTFile() ? 
getImportedOwningModule()71.6k
:
getLocalOwningModule()29.3M
;
754
29.4M
  }
755
756
  /// Get the module that owns this declaration for linkage purposes.
757
  /// There only ever is such a module under the C++ Modules TS.
758
  ///
759
  /// \param IgnoreLinkage Ignore the linkage of the entity; assume that
760
  /// all declarations in a global module fragment are unowned.
761
  Module *getOwningModuleForLinkage(bool IgnoreLinkage = false) const;
762
763
  /// Determine whether this declaration might be hidden from name
764
  /// lookup. Note that the declaration might be visible even if this returns
765
  /// \c false, if the owning module is visible within the query context.
766
  // FIXME: Rename this to make it clearer what it does.
767
158M
  bool isHidden() const {
768
158M
    return (int)getModuleOwnershipKind() > (int)ModuleOwnershipKind::Visible;
769
158M
  }
770
771
  /// Set that this declaration is globally visible, even if it came from a
772
  /// module that is not visible.
773
1.78M
  void setVisibleDespiteOwningModule() {
774
1.78M
    if (isHidden())
775
36.1k
      setModuleOwnershipKind(ModuleOwnershipKind::Visible);
776
1.78M
  }
777
778
  /// Get the kind of module ownership for this declaration.
779
243M
  ModuleOwnershipKind getModuleOwnershipKind() const {
780
243M
    return NextInContextAndBits.getInt();
781
243M
  }
782
783
  /// Set whether this declaration is hidden from name lookup.
784
747k
  void setModuleOwnershipKind(ModuleOwnershipKind MOK) {
785
747k
    assert(!(getModuleOwnershipKind() == ModuleOwnershipKind::Unowned &&
786
747k
             MOK != ModuleOwnershipKind::Unowned && !isFromASTFile() &&
787
747k
             !hasLocalOwningModuleStorage()) &&
788
747k
           "no storage available for owning module for this declaration");
789
747k
    NextInContextAndBits.setInt(MOK);
790
747k
  }
791
792
156M
  unsigned getIdentifierNamespace() const {
793
156M
    return IdentifierNamespace;
794
156M
  }
795
796
114M
  bool isInIdentifierNamespace(unsigned NS) const {
797
114M
    return getIdentifierNamespace() & NS;
798
114M
  }
799
800
  static unsigned getIdentifierNamespaceForKind(Kind DK);
801
802
5.09M
  bool hasTagIdentifierNamespace() const {
803
5.09M
    return isTagIdentifierNamespace(getIdentifierNamespace());
804
5.09M
  }
805
806
5.09M
  static bool isTagIdentifierNamespace(unsigned NS) {
807
5.09M
    // TagDecls have Tag and Type set and may also have TagFriend.
808
5.09M
    return (NS & ~IDNS_TagFriend) == (IDNS_Tag | IDNS_Type);
809
5.09M
  }
810
811
  /// getLexicalDeclContext - The declaration context where this Decl was
812
  /// lexically declared (LexicalDC). May be different from
813
  /// getDeclContext() (SemanticDC).
814
  /// e.g.:
815
  ///
816
  ///   namespace A {
817
  ///      void f(); // SemanticDC == LexicalDC == 'namespace A'
818
  ///   }
819
  ///   void A::f(); // SemanticDC == namespace 'A'
820
  ///                // LexicalDC == global namespace
821
303M
  DeclContext *getLexicalDeclContext() {
822
303M
    if (isInSemaDC())
823
285M
      return getSemanticDC();
824
17.7M
    return getMultipleDC()->LexicalDC;
825
17.7M
  }
826
201M
  const DeclContext *getLexicalDeclContext() const {
827
201M
    return const_cast<Decl*>(this)->getLexicalDeclContext();
828
201M
  }
829
830
  /// Determine whether this declaration is declared out of line (outside its
831
  /// semantic context).
832
  virtual bool isOutOfLine() const;
833
834
  /// setDeclContext - Set both the semantic and lexical DeclContext
835
  /// to DC.
836
  void setDeclContext(DeclContext *DC);
837
838
  void setLexicalDeclContext(DeclContext *DC);
839
840
  /// Determine whether this declaration is a templated entity (whether it is
841
  // within the scope of a template parameter).
842
  bool isTemplated() const;
843
844
  /// isDefinedOutsideFunctionOrMethod - This predicate returns true if this
845
  /// scoped decl is defined outside the current function or method.  This is
846
  /// roughly global variables and functions, but also handles enums (which
847
  /// could be defined inside or outside a function etc).
848
3.35M
  bool isDefinedOutsideFunctionOrMethod() const {
849
3.35M
    return getParentFunctionOrMethod() == nullptr;
850
3.35M
  }
851
852
  /// Returns true if this declaration lexically is inside a function.
853
  /// It recognizes non-defining declarations as well as members of local
854
  /// classes:
855
  /// \code
856
  ///     void foo() { void bar(); }
857
  ///     void foo2() { class ABC { void bar(); }; }
858
  /// \endcode
859
  bool isLexicallyWithinFunctionOrMethod() const;
860
861
  /// If this decl is defined inside a function/method/block it returns
862
  /// the corresponding DeclContext, otherwise it returns null.
863
  const DeclContext *getParentFunctionOrMethod() const;
864
32.7k
  DeclContext *getParentFunctionOrMethod() {
865
32.7k
    return const_cast<DeclContext*>(
866
32.7k
                    const_cast<const Decl*>(this)->getParentFunctionOrMethod());
867
32.7k
  }
868
869
  /// Retrieves the "canonical" declaration of the given declaration.
870
2.92M
  virtual Decl *getCanonicalDecl() { return this; }
871
145M
  const Decl *getCanonicalDecl() const {
872
145M
    return const_cast<Decl*>(this)->getCanonicalDecl();
873
145M
  }
874
875
  /// Whether this particular Decl is a canonical one.
876
4.76M
  bool isCanonicalDecl() const { return getCanonicalDecl() == this; }
877
878
protected:
879
  /// Returns the next redeclaration or itself if this is the only decl.
880
  ///
881
  /// Decl subclasses that can be redeclared should override this method so that
882
  /// Decl::redecl_iterator can iterate over them.
883
3.67M
  virtual Decl *getNextRedeclarationImpl() { return this; }
884
885
  /// Implementation of getPreviousDecl(), to be overridden by any
886
  /// subclass that has a redeclaration chain.
887
124
  virtual Decl *getPreviousDeclImpl() { return nullptr; }
888
889
  /// Implementation of getMostRecentDecl(), to be overridden by any
890
  /// subclass that has a redeclaration chain.
891
7.45M
  virtual Decl *getMostRecentDeclImpl() { return this; }
892
893
public:
894
  /// Iterates through all the redeclarations of the same decl.
895
  class redecl_iterator {
896
    /// Current - The current declaration.
897
    Decl *Current = nullptr;
898
    Decl *Starter;
899
900
  public:
901
    using value_type = Decl *;
902
    using reference = const value_type &;
903
    using pointer = const value_type *;
904
    using iterator_category = std::forward_iterator_tag;
905
    using difference_type = std::ptrdiff_t;
906
907
19.9M
    redecl_iterator() = default;
908
19.9M
    explicit redecl_iterator(Decl *C) : Current(C), Starter(C) {}
909
910
20.5M
    reference operator*() const { return Current; }
911
    value_type operator->() const { return Current; }
912
913
20.5M
    redecl_iterator& operator++() {
914
20.5M
      assert(Current && "Advancing while iterator has reached end");
915
20.5M
      // Get either previous decl or latest decl.
916
20.5M
      Decl *Next = Current->getNextRedeclarationImpl();
917
20.5M
      assert(Next && "Should return next redeclaration or itself, never null!");
918
20.5M
      Current = (Next != Starter) ? 
Next600k
:
nullptr19.9M
;
919
20.5M
      return *this;
920
20.5M
    }
921
922
0
    redecl_iterator operator++(int) {
923
0
      redecl_iterator tmp(*this);
924
0
      ++(*this);
925
0
      return tmp;
926
0
    }
927
928
0
    friend bool operator==(redecl_iterator x, redecl_iterator y) {
929
0
      return x.Current == y.Current;
930
0
    }
931
932
40.4M
    friend bool operator!=(redecl_iterator x, redecl_iterator y) {
933
40.4M
      return x.Current != y.Current;
934
40.4M
    }
935
  };
936
937
  using redecl_range = llvm::iterator_range<redecl_iterator>;
938
939
  /// Returns an iterator range for all the redeclarations of the same
940
  /// decl. It will iterate at least once (when this decl is the only one).
941
19.9M
  redecl_range redecls() const {
942
19.9M
    return redecl_range(redecls_begin(), redecls_end());
943
19.9M
  }
944
945
19.9M
  redecl_iterator redecls_begin() const {
946
19.9M
    return redecl_iterator(const_cast<Decl *>(this));
947
19.9M
  }
948
949
19.9M
  redecl_iterator redecls_end() const { return redecl_iterator(); }
950
951
  /// Retrieve the previous declaration that declares the same entity
952
  /// as this declaration, or NULL if there is no previous declaration.
953
4.61M
  Decl *getPreviousDecl() { return getPreviousDeclImpl(); }
954
955
  /// Retrieve the most recent declaration that declares the same entity
956
  /// as this declaration, or NULL if there is no previous declaration.
957
35.7k
  const Decl *getPreviousDecl() const {
958
35.7k
    return const_cast<Decl *>(this)->getPreviousDeclImpl();
959
35.7k
  }
960
961
  /// True if this is the first declaration in its redeclaration chain.
962
13
  bool isFirstDecl() const {
963
13
    return getPreviousDecl() == nullptr;
964
13
  }
965
966
  /// Retrieve the most recent declaration that declares the same entity
967
  /// as this declaration (which may be this declaration).
968
34.2M
  Decl *getMostRecentDecl() { return getMostRecentDeclImpl(); }
969
970
  /// Retrieve the most recent declaration that declares the same entity
971
  /// as this declaration (which may be this declaration).
972
71.3M
  const Decl *getMostRecentDecl() const {
973
71.3M
    return const_cast<Decl *>(this)->getMostRecentDeclImpl();
974
71.3M
  }
975
976
  /// getBody - If this Decl represents a declaration for a body of code,
977
  ///  such as a function or method definition, this method returns the
978
  ///  top-level Stmt* of that body.  Otherwise this method returns null.
979
100k
  virtual Stmt* getBody() const { return nullptr; }
980
981
  /// Returns true if this \c Decl represents a declaration for a body of
982
  /// code, such as a function or method definition.
983
  /// Note that \c hasBody can also return true if any redeclaration of this
984
  /// \c Decl represents a declaration for a body of code.
985
16.4k
  virtual bool hasBody() const { return getBody() != nullptr; }
986
987
  /// getBodyRBrace - Gets the right brace of the body, if a body exists.
988
  /// This works whether the body is a CompoundStmt or a CXXTryStmt.
989
  SourceLocation getBodyRBrace() const;
990
991
  // global temp stats (until we have a per-module visitor)
992
  static void add(Kind k);
993
  static void EnableStatistics();
994
  static void PrintStats();
995
996
  /// isTemplateParameter - Determines whether this declaration is a
997
  /// template parameter.
998
  bool isTemplateParameter() const;
999
1000
  /// isTemplateParameter - Determines whether this declaration is a
1001
  /// template parameter pack.
1002
  bool isTemplateParameterPack() const;
1003
1004
  /// Whether this declaration is a parameter pack.
1005
  bool isParameterPack() const;
1006
1007
  /// returns true if this declaration is a template
1008
  bool isTemplateDecl() const;
1009
1010
  /// Whether this declaration is a function or function template.
1011
88.9k
  bool isFunctionOrFunctionTemplate() const {
1012
88.9k
    return (DeclKind >= Decl::firstFunction &&
1013
88.9k
            
DeclKind <= Decl::lastFunction77.3k
) ||
1014
88.9k
           
DeclKind == FunctionTemplate75.2k
;
1015
88.9k
  }
1016
1017
  /// If this is a declaration that describes some template, this
1018
  /// method returns that template declaration.
1019
  TemplateDecl *getDescribedTemplate() const;
1020
1021
  /// Returns the function itself, or the templated function if this is a
1022
  /// function template.
1023
  FunctionDecl *getAsFunction() LLVM_READONLY;
1024
1025
17.5M
  const FunctionDecl *getAsFunction() const {
1026
17.5M
    return const_cast<Decl *>(this)->getAsFunction();
1027
17.5M
  }
1028
1029
  /// Changes the namespace of this declaration to reflect that it's
1030
  /// a function-local extern declaration.
1031
  ///
1032
  /// These declarations appear in the lexical context of the extern
1033
  /// declaration, but in the semantic context of the enclosing namespace
1034
  /// scope.
1035
2.96k
  void setLocalExternDecl() {
1036
2.96k
    Decl *Prev = getPreviousDecl();
1037
2.96k
    IdentifierNamespace &= ~IDNS_Ordinary;
1038
2.96k
1039
2.96k
    // It's OK for the declaration to still have the "invisible friend" flag or
1040
2.96k
    // the "conflicts with tag declarations in this scope" flag for the outer
1041
2.96k
    // scope.
1042
2.96k
    assert((IdentifierNamespace & ~(IDNS_OrdinaryFriend | IDNS_Tag)) == 0 &&
1043
2.96k
           "namespace is not ordinary");
1044
2.96k
1045
2.96k
    IdentifierNamespace |= IDNS_LocalExtern;
1046
2.96k
    if (Prev && 
Prev->getIdentifierNamespace() & IDNS_Ordinary6
)
1047
0
      IdentifierNamespace |= IDNS_Ordinary;
1048
2.96k
  }
1049
1050
  /// Determine whether this is a block-scope declaration with linkage.
1051
  /// This will either be a local variable declaration declared 'extern', or a
1052
  /// local function declaration.
1053
6.67M
  bool isLocalExternDecl() {
1054
6.67M
    return IdentifierNamespace & IDNS_LocalExtern;
1055
6.67M
  }
1056
1057
  /// Changes the namespace of this declaration to reflect that it's
1058
  /// the object of a friend declaration.
1059
  ///
1060
  /// These declarations appear in the lexical context of the friending
1061
  /// class, but in the semantic context of the actual entity.  This property
1062
  /// applies only to a specific decl object;  other redeclarations of the
1063
  /// same entity may not (and probably don't) share this property.
1064
199k
  void setObjectOfFriendDecl(bool PerformFriendInjection = false) {
1065
199k
    unsigned OldNS = IdentifierNamespace;
1066
199k
    assert((OldNS & (IDNS_Tag | IDNS_Ordinary |
1067
199k
                     IDNS_TagFriend | IDNS_OrdinaryFriend |
1068
199k
                     IDNS_LocalExtern | IDNS_NonMemberOperator)) &&
1069
199k
           "namespace includes neither ordinary nor tag");
1070
199k
    assert(!(OldNS & ~(IDNS_Tag | IDNS_Ordinary | IDNS_Type |
1071
199k
                       IDNS_TagFriend | IDNS_OrdinaryFriend |
1072
199k
                       IDNS_LocalExtern | IDNS_NonMemberOperator)) &&
1073
199k
           "namespace includes other than ordinary or tag");
1074
199k
1075
199k
    Decl *Prev = getPreviousDecl();
1076
199k
    IdentifierNamespace &= ~(IDNS_Ordinary | IDNS_Tag | IDNS_Type);
1077
199k
1078
199k
    if (OldNS & (IDNS_Tag | IDNS_TagFriend)) {
1079
32.2k
      IdentifierNamespace |= IDNS_TagFriend;
1080
32.2k
      if (PerformFriendInjection ||
1081
32.2k
          
(32.1k
Prev32.1k
&&
Prev->getIdentifierNamespace() & IDNS_Tag9.38k
))
1082
8.48k
        IdentifierNamespace |= IDNS_Tag | IDNS_Type;
1083
32.2k
    }
1084
199k
1085
199k
    if (OldNS & (IDNS_Ordinary | IDNS_OrdinaryFriend |
1086
199k
                 IDNS_LocalExtern | IDNS_NonMemberOperator)) {
1087
191k
      IdentifierNamespace |= IDNS_OrdinaryFriend;
1088
191k
      if (PerformFriendInjection ||
1089
191k
          (Prev && 
Prev->getIdentifierNamespace() & IDNS_Ordinary60.9k
))
1090
60.0k
        IdentifierNamespace |= IDNS_Ordinary;
1091
191k
    }
1092
199k
  }
1093
1094
  enum FriendObjectKind {
1095
    FOK_None,      ///< Not a friend object.
1096
    FOK_Declared,  ///< A friend of a previously-declared entity.
1097
    FOK_Undeclared ///< A friend of a previously-undeclared entity.
1098
  };
1099
1100
  /// Determines whether this declaration is the object of a
1101
  /// friend declaration and, if so, what kind.
1102
  ///
1103
  /// There is currently no direct way to find the associated FriendDecl.
1104
67.8M
  FriendObjectKind getFriendObjectKind() const {
1105
67.8M
    unsigned mask =
1106
67.8M
        (IdentifierNamespace & (IDNS_TagFriend | IDNS_OrdinaryFriend));
1107
67.8M
    if (!mask) 
return FOK_None67.6M
;
1108
211k
    return (IdentifierNamespace & (IDNS_Tag | IDNS_Ordinary) ? 
FOK_Declared46.8k
1109
211k
                                                             : 
FOK_Undeclared165k
);
1110
211k
  }
1111
1112
  /// Specifies that this declaration is a C++ overloaded non-member.
1113
147k
  void setNonMemberOperator() {
1114
147k
    assert(getKind() == Function || getKind() == FunctionTemplate);
1115
147k
    assert((IdentifierNamespace & IDNS_Ordinary) &&
1116
147k
           "visible non-member operators should be in ordinary namespace");
1117
147k
    IdentifierNamespace |= IDNS_NonMemberOperator;
1118
147k
  }
1119
1120
2.07M
  static bool classofKind(Kind K) { return true; }
1121
  static DeclContext *castToDeclContext(const Decl *);
1122
  static Decl *castFromDeclContext(const DeclContext *);
1123
1124
  void print(raw_ostream &Out, unsigned Indentation = 0,
1125
             bool PrintInstantiation = false) const;
1126
  void print(raw_ostream &Out, const PrintingPolicy &Policy,
1127
             unsigned Indentation = 0, bool PrintInstantiation = false) const;
1128
  static void printGroup(Decl** Begin, unsigned NumDecls,
1129
                         raw_ostream &Out, const PrintingPolicy &Policy,
1130
                         unsigned Indentation = 0);
1131
1132
  // Debuggers don't usually respect default arguments.
1133
  void dump() const;
1134
1135
  // Same as dump(), but forces color printing.
1136
  void dumpColor() const;
1137
1138
  void dump(raw_ostream &Out, bool Deserialize = false) const;
1139
1140
  /// \return Unique reproducible object identifier
1141
  int64_t getID() const;
1142
1143
  /// Looks through the Decl's underlying type to extract a FunctionType
1144
  /// when possible. Will return null if the type underlying the Decl does not
1145
  /// have a FunctionType.
1146
  const FunctionType *getFunctionType(bool BlocksToo = true) const;
1147
1148
private:
1149
  void setAttrsImpl(const AttrVec& Attrs, ASTContext &Ctx);
1150
  void setDeclContextsImpl(DeclContext *SemaDC, DeclContext *LexicalDC,
1151
                           ASTContext &Ctx);
1152
1153
protected:
1154
  ASTMutationListener *getASTMutationListener() const;
1155
};
1156
1157
/// Determine whether two declarations declare the same entity.
1158
2.38M
inline bool declaresSameEntity(const Decl *D1, const Decl *D2) {
1159
2.38M
  if (!D1 || 
!D22.38M
)
1160
38
    return false;
1161
2.38M
1162
2.38M
  if (D1 == D2)
1163
2.03M
    return true;
1164
346k
1165
346k
  return D1->getCanonicalDecl() == D2->getCanonicalDecl();
1166
346k
}
1167
1168
/// PrettyStackTraceDecl - If a crash occurs, indicate that it happened when
1169
/// doing something to a specific decl.
1170
class PrettyStackTraceDecl : public llvm::PrettyStackTraceEntry {
1171
  const Decl *TheDecl;
1172
  SourceLocation Loc;
1173
  SourceManager &SM;
1174
  const char *Message;
1175
1176
public:
1177
  PrettyStackTraceDecl(const Decl *theDecl, SourceLocation L,
1178
                       SourceManager &sm, const char *Msg)
1179
9.91M
      : TheDecl(theDecl), Loc(L), SM(sm), Message(Msg) {}
1180
1181
  void print(raw_ostream &OS) const override;
1182
};
1183
1184
/// The results of name lookup within a DeclContext. This is either a
1185
/// single result (with no stable storage) or a collection of results (with
1186
/// stable storage provided by the lookup table).
1187
class DeclContextLookupResult {
1188
  using ResultTy = ArrayRef<NamedDecl *>;
1189
1190
  ResultTy Result;
1191
1192
  // If there is only one lookup result, it would be invalidated by
1193
  // reallocations of the name table, so store it separately.
1194
  NamedDecl *Single = nullptr;
1195
1196
  static NamedDecl *const SingleElementDummyList;
1197
1198
public:
1199
167M
  DeclContextLookupResult() = default;
1200
  DeclContextLookupResult(ArrayRef<NamedDecl *> Result)
1201
6.89M
      : Result(Result) {}
1202
  DeclContextLookupResult(NamedDecl *Single)
1203
61.6M
      : Result(SingleElementDummyList), Single(Single) {}
1204
1205
  class iterator;
1206
1207
  using IteratorBase =
1208
      llvm::iterator_adaptor_base<iterator, ResultTy::iterator,
1209
                                  std::random_access_iterator_tag,
1210
                                  NamedDecl *const>;
1211
1212
  class iterator : public IteratorBase {
1213
    value_type SingleElement;
1214
1215
  public:
1216
    explicit iterator(pointer Pos, value_type Single = nullptr)
1217
410M
        : IteratorBase(Pos), SingleElement(Single) {}
1218
1219
105M
    reference operator*() const {
1220
105M
      return SingleElement ? 
SingleElement63.5M
:
IteratorBase::operator*()41.7M
;
1221
105M
    }
1222
  };
1223
1224
  using const_iterator = iterator;
1225
  using pointer = iterator::pointer;
1226
  using reference = iterator::reference;
1227
1228
205M
  iterator begin() const { return iterator(Result.begin(), Single); }
1229
205M
  iterator end() const { return iterator(Result.end(), Single); }
1230
1231
12.3M
  bool empty() const { return Result.empty(); }
1232
0
  pointer data() const { return Single ? &Single : Result.data(); }
1233
42.6k
  size_t size() const { return Single ? 
1926
:
Result.size()41.7k
; }
1234
2.64M
  reference front() const { return Single ? 
Single2.48M
:
Result.front()153k
; }
1235
0
  reference back() const { return Single ? Single : Result.back(); }
1236
1.45k
  reference operator[](size_t N) const { return Single ? 
Single1.18k
:
Result[N]268
; }
1237
1238
  // FIXME: Remove this from the interface
1239
324k
  DeclContextLookupResult slice(size_t N) const {
1240
324k
    DeclContextLookupResult Sliced = Result.slice(N);
1241
324k
    Sliced.Single = Single;
1242
324k
    return Sliced;
1243
324k
  }
1244
};
1245
1246
/// DeclContext - This is used only as base class of specific decl types that
1247
/// can act as declaration contexts. These decls are (only the top classes
1248
/// that directly derive from DeclContext are mentioned, not their subclasses):
1249
///
1250
///   TranslationUnitDecl
1251
///   ExternCContext
1252
///   NamespaceDecl
1253
///   TagDecl
1254
///   OMPDeclareReductionDecl
1255
///   FunctionDecl
1256
///   ObjCMethodDecl
1257
///   ObjCContainerDecl
1258
///   LinkageSpecDecl
1259
///   ExportDecl
1260
///   BlockDecl
1261
///   CapturedDecl
1262
class DeclContext {
1263
  /// For makeDeclVisibleInContextImpl
1264
  friend class ASTDeclReader;
1265
  /// For reconcileExternalVisibleStorage, CreateStoredDeclsMap,
1266
  /// hasNeedToReconcileExternalVisibleStorage
1267
  friend class ExternalASTSource;
1268
  /// For CreateStoredDeclsMap
1269
  friend class DependentDiagnostic;
1270
  /// For hasNeedToReconcileExternalVisibleStorage,
1271
  /// hasLazyLocalLexicalLookups, hasLazyExternalLexicalLookups
1272
  friend class ASTWriter;
1273
1274
  // We use uint64_t in the bit-fields below since some bit-fields
1275
  // cross the unsigned boundary and this breaks the packing.
1276
1277
  /// Stores the bits used by DeclContext.
1278
  /// If modified NumDeclContextBit, the ctor of DeclContext and the accessor
1279
  /// methods in DeclContext should be updated appropriately.
1280
  class DeclContextBitfields {
1281
    friend class DeclContext;
1282
    /// DeclKind - This indicates which class this is.
1283
    uint64_t DeclKind : 7;
1284
1285
    /// Whether this declaration context also has some external
1286
    /// storage that contains additional declarations that are lexically
1287
    /// part of this context.
1288
    mutable uint64_t ExternalLexicalStorage : 1;
1289
1290
    /// Whether this declaration context also has some external
1291
    /// storage that contains additional declarations that are visible
1292
    /// in this context.
1293
    mutable uint64_t ExternalVisibleStorage : 1;
1294
1295
    /// Whether this declaration context has had externally visible
1296
    /// storage added since the last lookup. In this case, \c LookupPtr's
1297
    /// invariant may not hold and needs to be fixed before we perform
1298
    /// another lookup.
1299
    mutable uint64_t NeedToReconcileExternalVisibleStorage : 1;
1300
1301
    /// If \c true, this context may have local lexical declarations
1302
    /// that are missing from the lookup table.
1303
    mutable uint64_t HasLazyLocalLexicalLookups : 1;
1304
1305
    /// If \c true, the external source may have lexical declarations
1306
    /// that are missing from the lookup table.
1307
    mutable uint64_t HasLazyExternalLexicalLookups : 1;
1308
1309
    /// If \c true, lookups should only return identifier from
1310
    /// DeclContext scope (for example TranslationUnit). Used in
1311
    /// LookupQualifiedName()
1312
    mutable uint64_t UseQualifiedLookup : 1;
1313
  };
1314
1315
  /// Number of bits in DeclContextBitfields.
1316
  enum { NumDeclContextBits = 13 };
1317
1318
  /// Stores the bits used by TagDecl.
1319
  /// If modified NumTagDeclBits and the accessor
1320
  /// methods in TagDecl should be updated appropriately.
1321
  class TagDeclBitfields {
1322
    friend class TagDecl;
1323
    /// For the bits in DeclContextBitfields
1324
    uint64_t : NumDeclContextBits;
1325
1326
    /// The TagKind enum.
1327
    uint64_t TagDeclKind : 3;
1328
1329
    /// True if this is a definition ("struct foo {};"), false if it is a
1330
    /// declaration ("struct foo;").  It is not considered a definition
1331
    /// until the definition has been fully processed.
1332
    uint64_t IsCompleteDefinition : 1;
1333
1334
    /// True if this is currently being defined.
1335
    uint64_t IsBeingDefined : 1;
1336
1337
    /// True if this tag declaration is "embedded" (i.e., defined or declared
1338
    /// for the very first time) in the syntax of a declarator.
1339
    uint64_t IsEmbeddedInDeclarator : 1;
1340
1341
    /// True if this tag is free standing, e.g. "struct foo;".
1342
    uint64_t IsFreeStanding : 1;
1343
1344
    /// Indicates whether it is possible for declarations of this kind
1345
    /// to have an out-of-date definition.
1346
    ///
1347
    /// This option is only enabled when modules are enabled.
1348
    uint64_t MayHaveOutOfDateDef : 1;
1349
1350
    /// Has the full definition of this type been required by a use somewhere in
1351
    /// the TU.
1352
    uint64_t IsCompleteDefinitionRequired : 1;
1353
  };
1354
1355
  /// Number of non-inherited bits in TagDeclBitfields.
1356
  enum { NumTagDeclBits = 9 };
1357
1358
  /// Stores the bits used by EnumDecl.
1359
  /// If modified NumEnumDeclBit and the accessor
1360
  /// methods in EnumDecl should be updated appropriately.
1361
  class EnumDeclBitfields {
1362
    friend class EnumDecl;
1363
    /// For the bits in DeclContextBitfields.
1364
    uint64_t : NumDeclContextBits;
1365
    /// For the bits in TagDeclBitfields.
1366
    uint64_t : NumTagDeclBits;
1367
1368
    /// Width in bits required to store all the non-negative
1369
    /// enumerators of this enum.
1370
    uint64_t NumPositiveBits : 8;
1371
1372
    /// Width in bits required to store all the negative
1373
    /// enumerators of this enum.
1374
    uint64_t NumNegativeBits : 8;
1375
1376
    /// True if this tag declaration is a scoped enumeration. Only
1377
    /// possible in C++11 mode.
1378
    uint64_t IsScoped : 1;
1379
1380
    /// If this tag declaration is a scoped enum,
1381
    /// then this is true if the scoped enum was declared using the class
1382
    /// tag, false if it was declared with the struct tag. No meaning is
1383
    /// associated if this tag declaration is not a scoped enum.
1384
    uint64_t IsScopedUsingClassTag : 1;
1385
1386
    /// True if this is an enumeration with fixed underlying type. Only
1387
    /// possible in C++11, Microsoft extensions, or Objective C mode.
1388
    uint64_t IsFixed : 1;
1389
1390
    /// True if a valid hash is stored in ODRHash.
1391
    uint64_t HasODRHash : 1;
1392
  };
1393
1394
  /// Number of non-inherited bits in EnumDeclBitfields.
1395
  enum { NumEnumDeclBits = 20 };
1396
1397
  /// Stores the bits used by RecordDecl.
1398
  /// If modified NumRecordDeclBits and the accessor
1399
  /// methods in RecordDecl should be updated appropriately.
1400
  class RecordDeclBitfields {
1401
    friend class RecordDecl;
1402
    /// For the bits in DeclContextBitfields.
1403
    uint64_t : NumDeclContextBits;
1404
    /// For the bits in TagDeclBitfields.
1405
    uint64_t : NumTagDeclBits;
1406
1407
    /// This is true if this struct ends with a flexible
1408
    /// array member (e.g. int X[]) or if this union contains a struct that does.
1409
    /// If so, this cannot be contained in arrays or other structs as a member.
1410
    uint64_t HasFlexibleArrayMember : 1;
1411
1412
    /// Whether this is the type of an anonymous struct or union.
1413
    uint64_t AnonymousStructOrUnion : 1;
1414
1415
    /// This is true if this struct has at least one member
1416
    /// containing an Objective-C object pointer type.
1417
    uint64_t HasObjectMember : 1;
1418
1419
    /// This is true if struct has at least one member of
1420
    /// 'volatile' type.
1421
    uint64_t HasVolatileMember : 1;
1422
1423
    /// Whether the field declarations of this record have been loaded
1424
    /// from external storage. To avoid unnecessary deserialization of
1425
    /// methods/nested types we allow deserialization of just the fields
1426
    /// when needed.
1427
    mutable uint64_t LoadedFieldsFromExternalStorage : 1;
1428
1429
    /// Basic properties of non-trivial C structs.
1430
    uint64_t NonTrivialToPrimitiveDefaultInitialize : 1;
1431
    uint64_t NonTrivialToPrimitiveCopy : 1;
1432
    uint64_t NonTrivialToPrimitiveDestroy : 1;
1433
1434
    /// Indicates whether this struct is destroyed in the callee.
1435
    uint64_t ParamDestroyedInCallee : 1;
1436
1437
    /// Represents the way this type is passed to a function.
1438
    uint64_t ArgPassingRestrictions : 2;
1439
  };
1440
1441
  /// Number of non-inherited bits in RecordDeclBitfields.
1442
  enum { NumRecordDeclBits = 11 };
1443
1444
  /// Stores the bits used by OMPDeclareReductionDecl.
1445
  /// If modified NumOMPDeclareReductionDeclBits and the accessor
1446
  /// methods in OMPDeclareReductionDecl should be updated appropriately.
1447
  class OMPDeclareReductionDeclBitfields {
1448
    friend class OMPDeclareReductionDecl;
1449
    /// For the bits in DeclContextBitfields
1450
    uint64_t : NumDeclContextBits;
1451
1452
    /// Kind of initializer,
1453
    /// function call or omp_priv<init_expr> initializtion.
1454
    uint64_t InitializerKind : 2;
1455
  };
1456
1457
  /// Number of non-inherited bits in OMPDeclareReductionDeclBitfields.
1458
  enum { NumOMPDeclareReductionDeclBits = 2 };
1459
1460
  /// Stores the bits used by FunctionDecl.
1461
  /// If modified NumFunctionDeclBits and the accessor
1462
  /// methods in FunctionDecl and CXXDeductionGuideDecl
1463
  /// (for IsCopyDeductionCandidate) should be updated appropriately.
1464
  class FunctionDeclBitfields {
1465
    friend class FunctionDecl;
1466
    /// For IsCopyDeductionCandidate
1467
    friend class CXXDeductionGuideDecl;
1468
    /// For the bits in DeclContextBitfields.
1469
    uint64_t : NumDeclContextBits;
1470
1471
    uint64_t SClass : 3;
1472
    uint64_t IsInline : 1;
1473
    uint64_t IsInlineSpecified : 1;
1474
1475
    /// This is shared by CXXConstructorDecl,
1476
    /// CXXConversionDecl, and CXXDeductionGuideDecl.
1477
    uint64_t IsExplicitSpecified : 1;
1478
1479
    uint64_t IsVirtualAsWritten : 1;
1480
    uint64_t IsPure : 1;
1481
    uint64_t HasInheritedPrototype : 1;
1482
    uint64_t HasWrittenPrototype : 1;
1483
    uint64_t IsDeleted : 1;
1484
    /// Used by CXXMethodDecl
1485
    uint64_t IsTrivial : 1;
1486
1487
    /// This flag indicates whether this function is trivial for the purpose of
1488
    /// calls. This is meaningful only when this function is a copy/move
1489
    /// constructor or a destructor.
1490
    uint64_t IsTrivialForCall : 1;
1491
1492
    /// Used by CXXMethodDecl
1493
    uint64_t IsDefaulted : 1;
1494
    /// Used by CXXMethodDecl
1495
    uint64_t IsExplicitlyDefaulted : 1;
1496
    uint64_t HasImplicitReturnZero : 1;
1497
    uint64_t IsLateTemplateParsed : 1;
1498
    uint64_t IsConstexpr : 1;
1499
    uint64_t InstantiationIsPending : 1;
1500
1501
    /// Indicates if the function uses __try.
1502
    uint64_t UsesSEHTry : 1;
1503
1504
    /// Indicates if the function was a definition
1505
    /// but its body was skipped.
1506
    uint64_t HasSkippedBody : 1;
1507
1508
    /// Indicates if the function declaration will
1509
    /// have a body, once we're done parsing it.
1510
    uint64_t WillHaveBody : 1;
1511
1512
    /// Indicates that this function is a multiversioned
1513
    /// function using attribute 'target'.
1514
    uint64_t IsMultiVersion : 1;
1515
1516
    /// [C++17] Only used by CXXDeductionGuideDecl. Indicates that
1517
    /// the Deduction Guide is the implicitly generated 'copy
1518
    /// deduction candidate' (is used during overload resolution).
1519
    uint64_t IsCopyDeductionCandidate : 1;
1520
1521
    /// Store the ODRHash after first calculation.
1522
    uint64_t HasODRHash : 1;
1523
  };
1524
1525
  /// Number of non-inherited bits in FunctionDeclBitfields.
1526
  enum { NumFunctionDeclBits = 25 };
1527
1528
  /// Stores the bits used by CXXConstructorDecl. If modified
1529
  /// NumCXXConstructorDeclBits and the accessor
1530
  /// methods in CXXConstructorDecl should be updated appropriately.
1531
  class CXXConstructorDeclBitfields {
1532
    friend class CXXConstructorDecl;
1533
    /// For the bits in DeclContextBitfields.
1534
    uint64_t : NumDeclContextBits;
1535
    /// For the bits in FunctionDeclBitfields.
1536
    uint64_t : NumFunctionDeclBits;
1537
1538
    /// 25 bits to fit in the remaining availible space.
1539
    /// Note that this makes CXXConstructorDeclBitfields take
1540
    /// exactly 64 bits and thus the width of NumCtorInitializers
1541
    /// will need to be shrunk if some bit is added to NumDeclContextBitfields,
1542
    /// NumFunctionDeclBitfields or CXXConstructorDeclBitfields.
1543
    uint64_t NumCtorInitializers : 25;
1544
    uint64_t IsInheritingConstructor : 1;
1545
  };
1546
1547
  /// Number of non-inherited bits in CXXConstructorDeclBitfields.
1548
  enum { NumCXXConstructorDeclBits = 26 };
1549
1550
  /// Stores the bits used by ObjCMethodDecl.
1551
  /// If modified NumObjCMethodDeclBits and the accessor
1552
  /// methods in ObjCMethodDecl should be updated appropriately.
1553
  class ObjCMethodDeclBitfields {
1554
    friend class ObjCMethodDecl;
1555
1556
    /// For the bits in DeclContextBitfields.
1557
    uint64_t : NumDeclContextBits;
1558
1559
    /// The conventional meaning of this method; an ObjCMethodFamily.
1560
    /// This is not serialized; instead, it is computed on demand and
1561
    /// cached.
1562
    mutable uint64_t Family : ObjCMethodFamilyBitWidth;
1563
1564
    /// instance (true) or class (false) method.
1565
    uint64_t IsInstance : 1;
1566
    uint64_t IsVariadic : 1;
1567
1568
    /// True if this method is the getter or setter for an explicit property.
1569
    uint64_t IsPropertyAccessor : 1;
1570
1571
    /// Method has a definition.
1572
    uint64_t IsDefined : 1;
1573
1574
    /// Method redeclaration in the same interface.
1575
    uint64_t IsRedeclaration : 1;
1576
1577
    /// Is redeclared in the same interface.
1578
    mutable uint64_t HasRedeclaration : 1;
1579
1580
    /// \@required/\@optional
1581
    uint64_t DeclImplementation : 2;
1582
1583
    /// in, inout, etc.
1584
    uint64_t objcDeclQualifier : 7;
1585
1586
    /// Indicates whether this method has a related result type.
1587
    uint64_t RelatedResultType : 1;
1588
1589
    /// Whether the locations of the selector identifiers are in a
1590
    /// "standard" position, a enum SelectorLocationsKind.
1591
    uint64_t SelLocsKind : 2;
1592
1593
    /// Whether this method overrides any other in the class hierarchy.
1594
    ///
1595
    /// A method is said to override any method in the class's
1596
    /// base classes, its protocols, or its categories' protocols, that has
1597
    /// the same selector and is of the same kind (class or instance).
1598
    /// A method in an implementation is not considered as overriding the same
1599
    /// method in the interface or its categories.
1600
    uint64_t IsOverriding : 1;
1601
1602
    /// Indicates if the method was a definition but its body was skipped.
1603
    uint64_t HasSkippedBody : 1;
1604
  };
1605
1606
  /// Number of non-inherited bits in ObjCMethodDeclBitfields.
1607
  enum { NumObjCMethodDeclBits = 24 };
1608
1609
  /// Stores the bits used by ObjCContainerDecl.
1610
  /// If modified NumObjCContainerDeclBits and the accessor
1611
  /// methods in ObjCContainerDecl should be updated appropriately.
1612
  class ObjCContainerDeclBitfields {
1613
    friend class ObjCContainerDecl;
1614
    /// For the bits in DeclContextBitfields
1615
    uint32_t : NumDeclContextBits;
1616
1617
    // Not a bitfield but this saves space.
1618
    // Note that ObjCContainerDeclBitfields is full.
1619
    SourceLocation AtStart;
1620
  };
1621
1622
  /// Number of non-inherited bits in ObjCContainerDeclBitfields.
1623
  /// Note that here we rely on the fact that SourceLocation is 32 bits
1624
  /// wide. We check this with the static_assert in the ctor of DeclContext.
1625
  enum { NumObjCContainerDeclBits = 64 - NumDeclContextBits };
1626
1627
  /// Stores the bits used by LinkageSpecDecl.
1628
  /// If modified NumLinkageSpecDeclBits and the accessor
1629
  /// methods in LinkageSpecDecl should be updated appropriately.
1630
  class LinkageSpecDeclBitfields {
1631
    friend class LinkageSpecDecl;
1632
    /// For the bits in DeclContextBitfields.
1633
    uint64_t : NumDeclContextBits;
1634
1635
    /// The language for this linkage specification with values
1636
    /// in the enum LinkageSpecDecl::LanguageIDs.
1637
    uint64_t Language : 3;
1638
1639
    /// True if this linkage spec has braces.
1640
    /// This is needed so that hasBraces() returns the correct result while the
1641
    /// linkage spec body is being parsed.  Once RBraceLoc has been set this is
1642
    /// not used, so it doesn't need to be serialized.
1643
    uint64_t HasBraces : 1;
1644
  };
1645
1646
  /// Number of non-inherited bits in LinkageSpecDeclBitfields.
1647
  enum { NumLinkageSpecDeclBits = 4 };
1648
1649
  /// Stores the bits used by BlockDecl.
1650
  /// If modified NumBlockDeclBits and the accessor
1651
  /// methods in BlockDecl should be updated appropriately.
1652
  class BlockDeclBitfields {
1653
    friend class BlockDecl;
1654
    /// For the bits in DeclContextBitfields.
1655
    uint64_t : NumDeclContextBits;
1656
1657
    uint64_t IsVariadic : 1;
1658
    uint64_t CapturesCXXThis : 1;
1659
    uint64_t BlockMissingReturnType : 1;
1660
    uint64_t IsConversionFromLambda : 1;
1661
1662
    /// A bit that indicates this block is passed directly to a function as a
1663
    /// non-escaping parameter.
1664
    uint64_t DoesNotEscape : 1;
1665
  };
1666
1667
  /// Number of non-inherited bits in BlockDeclBitfields.
1668
  enum { NumBlockDeclBits = 5 };
1669
1670
  /// Pointer to the data structure used to lookup declarations
1671
  /// within this context (or a DependentStoredDeclsMap if this is a
1672
  /// dependent context). We maintain the invariant that, if the map
1673
  /// contains an entry for a DeclarationName (and we haven't lazily
1674
  /// omitted anything), then it contains all relevant entries for that
1675
  /// name (modulo the hasExternalDecls() flag).
1676
  mutable StoredDeclsMap *LookupPtr = nullptr;
1677
1678
protected:
1679
  /// This anonymous union stores the bits belonging to DeclContext and classes
1680
  /// deriving from it. The goal is to use otherwise wasted
1681
  /// space in DeclContext to store data belonging to derived classes.
1682
  /// The space saved is especially significient when pointers are aligned
1683
  /// to 8 bytes. In this case due to alignment requirements we have a
1684
  /// little less than 8 bytes free in DeclContext which we can use.
1685
  /// We check that none of the classes in this union is larger than
1686
  /// 8 bytes with static_asserts in the ctor of DeclContext.
1687
  union {
1688
    DeclContextBitfields DeclContextBits;
1689
    TagDeclBitfields TagDeclBits;
1690
    EnumDeclBitfields EnumDeclBits;
1691
    RecordDeclBitfields RecordDeclBits;
1692
    OMPDeclareReductionDeclBitfields OMPDeclareReductionDeclBits;
1693
    FunctionDeclBitfields FunctionDeclBits;
1694
    CXXConstructorDeclBitfields CXXConstructorDeclBits;
1695
    ObjCMethodDeclBitfields ObjCMethodDeclBits;
1696
    ObjCContainerDeclBitfields ObjCContainerDeclBits;
1697
    LinkageSpecDeclBitfields LinkageSpecDeclBits;
1698
    BlockDeclBitfields BlockDeclBits;
1699
1700
    static_assert(sizeof(DeclContextBitfields) <= 8,
1701
                  "DeclContextBitfields is larger than 8 bytes!");
1702
    static_assert(sizeof(TagDeclBitfields) <= 8,
1703
                  "TagDeclBitfields is larger than 8 bytes!");
1704
    static_assert(sizeof(EnumDeclBitfields) <= 8,
1705
                  "EnumDeclBitfields is larger than 8 bytes!");
1706
    static_assert(sizeof(RecordDeclBitfields) <= 8,
1707
                  "RecordDeclBitfields is larger than 8 bytes!");
1708
    static_assert(sizeof(OMPDeclareReductionDeclBitfields) <= 8,
1709
                  "OMPDeclareReductionDeclBitfields is larger than 8 bytes!");
1710
    static_assert(sizeof(FunctionDeclBitfields) <= 8,
1711
                  "FunctionDeclBitfields is larger than 8 bytes!");
1712
    static_assert(sizeof(CXXConstructorDeclBitfields) <= 8,
1713
                  "CXXConstructorDeclBitfields is larger than 8 bytes!");
1714
    static_assert(sizeof(ObjCMethodDeclBitfields) <= 8,
1715
                  "ObjCMethodDeclBitfields is larger than 8 bytes!");
1716
    static_assert(sizeof(ObjCContainerDeclBitfields) <= 8,
1717
                  "ObjCContainerDeclBitfields is larger than 8 bytes!");
1718
    static_assert(sizeof(LinkageSpecDeclBitfields) <= 8,
1719
                  "LinkageSpecDeclBitfields is larger than 8 bytes!");
1720
    static_assert(sizeof(BlockDeclBitfields) <= 8,
1721
                  "BlockDeclBitfields is larger than 8 bytes!");
1722
  };
1723
1724
  /// FirstDecl - The first declaration stored within this declaration
1725
  /// context.
1726
  mutable Decl *FirstDecl = nullptr;
1727
1728
  /// LastDecl - The last declaration stored within this declaration
1729
  /// context. FIXME: We could probably cache this value somewhere
1730
  /// outside of the DeclContext, to reduce the size of DeclContext by
1731
  /// another pointer.
1732
  mutable Decl *LastDecl = nullptr;
1733
1734
  /// Build up a chain of declarations.
1735
  ///
1736
  /// \returns the first/last pair of declarations.
1737
  static std::pair<Decl *, Decl *>
1738
  BuildDeclChain(ArrayRef<Decl*> Decls, bool FieldsAlreadyLoaded);
1739
1740
  DeclContext(Decl::Kind K);
1741
1742
public:
1743
  ~DeclContext();
1744
1745
12.3G
  Decl::Kind getDeclKind() const {
1746
12.3G
    return static_cast<Decl::Kind>(DeclContextBits.DeclKind);
1747
12.3G
  }
1748
1749
  const char *getDeclKindName() const;
1750
1751
  /// getParent - Returns the containing DeclContext.
1752
1.71G
  DeclContext *getParent() {
1753
1.71G
    return cast<Decl>(this)->getDeclContext();
1754
1.71G
  }
1755
344M
  const DeclContext *getParent() const {
1756
344M
    return const_cast<DeclContext*>(this)->getParent();
1757
344M
  }
1758
1759
  /// getLexicalParent - Returns the containing lexical DeclContext. May be
1760
  /// different from getParent, e.g.:
1761
  ///
1762
  ///   namespace A {
1763
  ///      struct S;
1764
  ///   }
1765
  ///   struct A::S {}; // getParent() == namespace 'A'
1766
  ///                   // getLexicalParent() == translation unit
1767
  ///
1768
65.8M
  DeclContext *getLexicalParent() {
1769
65.8M
    return cast<Decl>(this)->getLexicalDeclContext();
1770
65.8M
  }
1771
51.9M
  const DeclContext *getLexicalParent() const {
1772
51.9M
    return const_cast<DeclContext*>(this)->getLexicalParent();
1773
51.9M
  }
1774
1775
  DeclContext *getLookupParent();
1776
1777
99
  const DeclContext *getLookupParent() const {
1778
99
    return const_cast<DeclContext*>(this)->getLookupParent();
1779
99
  }
1780
1781
242M
  ASTContext &getParentASTContext() const {
1782
242M
    return cast<Decl>(this)->getASTContext();
1783
242M
  }
1784
1785
1.23k
  bool isClosure() const { return getDeclKind() == Decl::Block; }
1786
1787
5.51M
  bool isObjCContainer() const {
1788
5.51M
    switch (getDeclKind()) {
1789
5.51M
    case Decl::ObjCCategory:
1790
59.9k
    case Decl::ObjCCategoryImpl:
1791
59.9k
    case Decl::ObjCImplementation:
1792
59.9k
    case Decl::ObjCInterface:
1793
59.9k
    case Decl::ObjCProtocol:
1794
59.9k
      return true;
1795
5.45M
    default:
1796
5.45M
      return false;
1797
5.51M
    }
1798
5.51M
  }
1799
1800
221M
  bool isFunctionOrMethod() const {
1801
221M
    switch (getDeclKind()) {
1802
221M
    case Decl::Block:
1803
3.47M
    case Decl::Captured:
1804
3.47M
    case Decl::ObjCMethod:
1805
3.47M
      return true;
1806
217M
    default:
1807
217M
      return getDeclKind() >= Decl::firstFunction &&
1808
217M
             
getDeclKind() <= Decl::lastFunction90.2M
;
1809
221M
    }
1810
221M
  }
1811
1812
  /// Test whether the context supports looking up names.
1813
37.3M
  bool isLookupContext() const {
1814
37.3M
    return !isFunctionOrMethod() && 
getDeclKind() != Decl::LinkageSpec27.6M
&&
1815
37.3M
           
getDeclKind() != Decl::Export26.3M
;
1816
37.3M
  }
1817
1818
732M
  bool isFileContext() const {
1819
732M
    return getDeclKind() == Decl::TranslationUnit ||
1820
732M
           
getDeclKind() == Decl::Namespace615M
;
1821
732M
  }
1822
1823
2.15G
  bool isTranslationUnit() const {
1824
2.15G
    return getDeclKind() == Decl::TranslationUnit;
1825
2.15G
  }
1826
1827
404M
  bool isRecord() const {
1828
404M
    return getDeclKind() >= Decl::firstRecord &&
1829
404M
           
getDeclKind() <= Decl::lastRecord346M
;
1830
404M
  }
1831
1832
44.8M
  bool isNamespace() const { return getDeclKind() == Decl::Namespace; }
1833
1834
  bool isStdNamespace() const;
1835
1836
  bool isInlineNamespace() const;
1837
1838
  /// Determines whether this context is dependent on a
1839
  /// template parameter.
1840
  bool isDependentContext() const;
1841
1842
  /// isTransparentContext - Determines whether this context is a
1843
  /// "transparent" context, meaning that the members declared in this
1844
  /// context are semantically declared in the nearest enclosing
1845
  /// non-transparent (opaque) context but are lexically declared in
1846
  /// this context. For example, consider the enumerators of an
1847
  /// enumeration type:
1848
  /// @code
1849
  /// enum E {
1850
  ///   Val1
1851
  /// };
1852
  /// @endcode
1853
  /// Here, E is a transparent context, so its enumerator (Val1) will
1854
  /// appear (semantically) that it is in the same context of E.
1855
  /// Examples of transparent contexts include: enumerations (except for
1856
  /// C++0x scoped enums), and C++ linkage specifications.
1857
  bool isTransparentContext() const;
1858
1859
  /// Determines whether this context or some of its ancestors is a
1860
  /// linkage specification context that specifies C linkage.
1861
  bool isExternCContext() const;
1862
1863
  /// Retrieve the nearest enclosing C linkage specification context.
1864
  const LinkageSpecDecl *getExternCContext() const;
1865
1866
  /// Determines whether this context or some of its ancestors is a
1867
  /// linkage specification context that specifies C++ linkage.
1868
  bool isExternCXXContext() const;
1869
1870
  /// Determine whether this declaration context is equivalent
1871
  /// to the declaration context DC.
1872
285M
  bool Equals(const DeclContext *DC) const {
1873
285M
    return DC && 
this->getPrimaryContext() == DC->getPrimaryContext()270M
;
1874
285M
  }
1875
1876
  /// Determine whether this declaration context encloses the
1877
  /// declaration context DC.
1878
  bool Encloses(const DeclContext *DC) const;
1879
1880
  /// Find the nearest non-closure ancestor of this context,
1881
  /// i.e. the innermost semantic parent of this context which is not
1882
  /// a closure.  A context may be its own non-closure ancestor.
1883
  Decl *getNonClosureAncestor();
1884
0
  const Decl *getNonClosureAncestor() const {
1885
0
    return const_cast<DeclContext*>(this)->getNonClosureAncestor();
1886
0
  }
1887
1888
  /// getPrimaryContext - There may be many different
1889
  /// declarations of the same entity (including forward declarations
1890
  /// of classes, multiple definitions of namespaces, etc.), each with
1891
  /// a different set of declarations. This routine returns the
1892
  /// "primary" DeclContext structure, which will contain the
1893
  /// information needed to perform name lookup into this context.
1894
  DeclContext *getPrimaryContext();
1895
961M
  const DeclContext *getPrimaryContext() const {
1896
961M
    return const_cast<DeclContext*>(this)->getPrimaryContext();
1897
961M
  }
1898
1899
  /// getRedeclContext - Retrieve the context in which an entity conflicts with
1900
  /// other entities of the same name, or where it is a redeclaration if the
1901
  /// two entities are compatible. This skips through transparent contexts.
1902
  DeclContext *getRedeclContext();
1903
227M
  const DeclContext *getRedeclContext() const {
1904
227M
    return const_cast<DeclContext *>(this)->getRedeclContext();
1905
227M
  }
1906
1907
  /// Retrieve the nearest enclosing namespace context.
1908
  DeclContext *getEnclosingNamespaceContext();
1909
41.4k
  const DeclContext *getEnclosingNamespaceContext() const {
1910
41.4k
    return const_cast<DeclContext *>(this)->getEnclosingNamespaceContext();
1911
41.4k
  }
1912
1913
  /// Retrieve the outermost lexically enclosing record context.
1914
  RecordDecl *getOuterLexicalRecordContext();
1915
0
  const RecordDecl *getOuterLexicalRecordContext() const {
1916
0
    return const_cast<DeclContext *>(this)->getOuterLexicalRecordContext();
1917
0
  }
1918
1919
  /// Test if this context is part of the enclosing namespace set of
1920
  /// the context NS, as defined in C++0x [namespace.def]p9. If either context
1921
  /// isn't a namespace, this is equivalent to Equals().
1922
  ///
1923
  /// The enclosing namespace set of a namespace is the namespace and, if it is
1924
  /// inline, its enclosing namespace, recursively.
1925
  bool InEnclosingNamespaceSetOf(const DeclContext *NS) const;
1926
1927
  /// Collects all of the declaration contexts that are semantically
1928
  /// connected to this declaration context.
1929
  ///
1930
  /// For declaration contexts that have multiple semantically connected but
1931
  /// syntactically distinct contexts, such as C++ namespaces, this routine
1932
  /// retrieves the complete set of such declaration contexts in source order.
1933
  /// For example, given:
1934
  ///
1935
  /// \code
1936
  /// namespace N {
1937
  ///   int x;
1938
  /// }
1939
  /// namespace N {
1940
  ///   int y;
1941
  /// }
1942
  /// \endcode
1943
  ///
1944
  /// The \c Contexts parameter will contain both definitions of N.
1945
  ///
1946
  /// \param Contexts Will be cleared and set to the set of declaration
1947
  /// contexts that are semanticaly connected to this declaration context,
1948
  /// in source order, including this context (which may be the only result,
1949
  /// for non-namespace contexts).
1950
  void collectAllContexts(SmallVectorImpl<DeclContext *> &Contexts);
1951
1952
  /// decl_iterator - Iterates through the declarations stored
1953
  /// within this context.
1954
  class decl_iterator {
1955
    /// Current - The current declaration.
1956
    Decl *Current = nullptr;
1957
1958
  public:
1959
    using value_type = Decl *;
1960
    using reference = const value_type &;
1961
    using pointer = const value_type *;
1962
    using iterator_category = std::forward_iterator_tag;
1963
    using difference_type = std::ptrdiff_t;
1964
1965
28.9M
    decl_iterator() = default;
1966
28.9M
    explicit decl_iterator(Decl *C) : Current(C) {}
1967
1968
281M
    reference operator*() const { return Current; }
1969
1970
    // This doesn't meet the iterator requirements, but it's convenient
1971
22.5k
    value_type operator->() const { return Current; }
1972
1973
135M
    decl_iterator& operator++() {
1974
135M
      Current = Current->getNextDeclInContext();
1975
135M
      return *this;
1976
135M
    }
1977
1978
41
    decl_iterator operator++(int) {
1979
41
      decl_iterator tmp(*this);
1980
41
      ++(*this);
1981
41
      return tmp;
1982
41
    }
1983
1984
1.34M
    friend bool operator==(decl_iterator x, decl_iterator y) {
1985
1.34M
      return x.Current == y.Current;
1986
1.34M
    }
1987
1988
89.3M
    friend bool operator!=(decl_iterator x, decl_iterator y) {
1989
89.3M
      return x.Current != y.Current;
1990
89.3M
    }
1991
  };
1992
1993
  using decl_range = llvm::iterator_range<decl_iterator>;
1994
1995
  /// decls_begin/decls_end - Iterate over the declarations stored in
1996
  /// this context.
1997
11.8M
  decl_range decls() const { return decl_range(decls_begin(), decls_end()); }
1998
  decl_iterator decls_begin() const;
1999
19.0M
  decl_iterator decls_end() const { return decl_iterator(); }
2000
  bool decls_empty() const;
2001
2002
  /// noload_decls_begin/end - Iterate over the declarations stored in this
2003
  /// context that are currently loaded; don't attempt to retrieve anything
2004
  /// from an external source.
2005
2.55M
  decl_range noload_decls() const {
2006
2.55M
    return decl_range(noload_decls_begin(), noload_decls_end());
2007
2.55M
  }
2008
2.55M
  decl_iterator noload_decls_begin() const { return decl_iterator(FirstDecl); }
2009
2.55M
  decl_iterator noload_decls_end() const { return decl_iterator(); }
2010
2011
  /// specific_decl_iterator - Iterates over a subrange of
2012
  /// declarations stored in a DeclContext, providing only those that
2013
  /// are of type SpecificDecl (or a class derived from it). This
2014
  /// iterator is used, for example, to provide iteration over just
2015
  /// the fields within a RecordDecl (with SpecificDecl = FieldDecl).
2016
  template<typename SpecificDecl>
2017
  class specific_decl_iterator {
2018
    /// Current - The current, underlying declaration iterator, which
2019
    /// will either be NULL or will point to a declaration of
2020
    /// type SpecificDecl.
2021
    DeclContext::decl_iterator Current;
2022
2023
    /// SkipToNextDecl - Advances the current position up to the next
2024
    /// declaration of type SpecificDecl that also meets the criteria
2025
    /// required by Acceptable.
2026
49.3M
    void SkipToNextDecl() {
2027
121M
      while (*Current && 
!isa<SpecificDecl>(*Current)93.3M
)
2028
72.3M
        ++Current;
2029
49.3M
    }
clang::DeclContext::specific_decl_iterator<clang::FieldDecl>::SkipToNextDecl()
Line
Count
Source
2026
24.0M
    void SkipToNextDecl() {
2027
74.0M
      while (*Current && 
!isa<SpecificDecl>(*Current)59.7M
)
2028
49.9M
        ++Current;
2029
24.0M
    }
clang::DeclContext::specific_decl_iterator<clang::CXXMethodDecl>::SkipToNextDecl()
Line
Count
Source
2026
22.4M
    void SkipToNextDecl() {
2027
44.3M
      while (*Current && 
!isa<SpecificDecl>(*Current)31.9M
)
2028
21.9M
        ++Current;
2029
22.4M
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyDecl>::SkipToNextDecl()
Line
Count
Source
2026
121k
    void SkipToNextDecl() {
2027
273k
      while (*Current && 
!isa<SpecificDecl>(*Current)184k
)
2028
151k
        ++Current;
2029
121k
    }
clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl>::SkipToNextDecl()
Line
Count
Source
2026
217k
    void SkipToNextDecl() {
2027
217k
      while (*Current && 
!isa<SpecificDecl>(*Current)146k
)
2028
13
        ++Current;
2029
217k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyImplDecl>::SkipToNextDecl()
Line
Count
Source
2026
90.6k
    void SkipToNextDecl() {
2027
160k
      while (*Current && 
!isa<SpecificDecl>(*Current)111k
)
2028
70.0k
        ++Current;
2029
90.6k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl>::SkipToNextDecl()
Line
Count
Source
2026
10.9k
    void SkipToNextDecl() {
2027
12.8k
      while (*Current && 
!isa<SpecificDecl>(*Current)7.04k
)
2028
1.81k
        ++Current;
2029
10.9k
    }
clang::DeclContext::specific_decl_iterator<clang::CXXConstructorDecl>::SkipToNextDecl()
Line
Count
Source
2026
15.5k
    void SkipToNextDecl() {
2027
82.2k
      while (*Current && 
!isa<SpecificDecl>(*Current)75.3k
)
2028
66.6k
        ++Current;
2029
15.5k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl>::SkipToNextDecl()
Line
Count
Source
2026
150k
    void SkipToNextDecl() {
2027
364k
      while (*Current && 
!isa<SpecificDecl>(*Current)249k
)
2028
214k
        ++Current;
2029
150k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCImplementationDecl>::SkipToNextDecl()
Line
Count
Source
2026
282
    void SkipToNextDecl() {
2027
2.82k
      while (*Current && 
!isa<SpecificDecl>(*Current)2.64k
)
2028
2.54k
        ++Current;
2029
282
    }
clang::DeclContext::specific_decl_iterator<clang::NamespaceDecl>::SkipToNextDecl()
Line
Count
Source
2026
5
    void SkipToNextDecl() {
2027
6
      while (*Current && 
!isa<SpecificDecl>(*Current)4
)
2028
1
        ++Current;
2029
5
    }
clang::DeclContext::specific_decl_iterator<clang::FunctionTemplateDecl>::SkipToNextDecl()
Line
Count
Source
2026
4
    void SkipToNextDecl() {
2027
6
      while (*Current && 
!isa<SpecificDecl>(*Current)4
)
2028
2
        ++Current;
2029
4
    }
clang::DeclContext::specific_decl_iterator<clang::VarDecl>::SkipToNextDecl()
Line
Count
Source
2026
2.22M
    void SkipToNextDecl() {
2027
2.23M
      while (*Current && 
!isa<SpecificDecl>(*Current)987k
)
2028
9.28k
        ++Current;
2029
2.22M
    }
2030
2031
  public:
2032
    using value_type = SpecificDecl *;
2033
    // TODO: Add reference and pointer types (with some appropriate proxy type)
2034
    // if we ever have a need for them.
2035
    using reference = void;
2036
    using pointer = void;
2037
    using difference_type =
2038
        std::iterator_traits<DeclContext::decl_iterator>::difference_type;
2039
    using iterator_category = std::forward_iterator_tag;
2040
2041
49.9k
    specific_decl_iterator() = default;
clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl>::specific_decl_iterator()
Line
Count
Source
2041
48.6k
    specific_decl_iterator() = default;
clang::DeclContext::specific_decl_iterator<clang::FieldDecl>::specific_decl_iterator()
Line
Count
Source
2041
1.27k
    specific_decl_iterator() = default;
2042
2043
    /// specific_decl_iterator - Construct a new iterator over a
2044
    /// subset of the declarations the range [C,
2045
    /// end-of-declarations). If A is non-NULL, it is a pointer to a
2046
    /// member function of SpecificDecl that should return true for
2047
    /// all of the SpecificDecl instances that will be in the subset
2048
    /// of iterators. For example, if you want Objective-C instance
2049
    /// methods, SpecificDecl will be ObjCMethodDecl and A will be
2050
    /// &ObjCMethodDecl::isInstanceMethod.
2051
28.7M
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
28.7M
      SkipToNextDecl();
2053
28.7M
    }
clang::DeclContext::specific_decl_iterator<clang::FieldDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
14.5M
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
14.5M
      SkipToNextDecl();
2053
14.5M
    }
clang::DeclContext::specific_decl_iterator<clang::CXXMethodDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
12.5M
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
12.5M
      SkipToNextDecl();
2053
12.5M
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
88.7k
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
88.7k
      SkipToNextDecl();
2053
88.7k
    }
clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
115k
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
115k
      SkipToNextDecl();
2053
115k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyImplDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
53.3k
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
53.3k
      SkipToNextDecl();
2053
53.3k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
5.78k
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
5.78k
      SkipToNextDecl();
2053
5.78k
    }
clang::DeclContext::specific_decl_iterator<clang::CXXConstructorDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
8.36k
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
8.36k
      SkipToNextDecl();
2053
8.36k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
125k
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
125k
      SkipToNextDecl();
2053
125k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCImplementationDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
178
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
178
      SkipToNextDecl();
2053
178
    }
clang::DeclContext::specific_decl_iterator<clang::NamespaceDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
2
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
2
      SkipToNextDecl();
2053
2
    }
clang::DeclContext::specific_decl_iterator<clang::FunctionTemplateDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
4
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
4
      SkipToNextDecl();
2053
4
    }
clang::DeclContext::specific_decl_iterator<clang::VarDecl>::specific_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2051
1.24M
    explicit specific_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2052
1.24M
      SkipToNextDecl();
2053
1.24M
    }
2054
2055
23.6M
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::FieldDecl>::operator*() const
Line
Count
Source
2055
12.4M
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::CXXMethodDecl>::operator*() const
Line
Count
Source
2055
9.99M
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyDecl>::operator*() const
Line
Count
Source
2055
32.9k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl>::operator*() const
Line
Count
Source
2055
101k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyImplDecl>::operator*() const
Line
Count
Source
2055
41.1k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl>::operator*() const
Line
Count
Source
2055
5.20k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::CXXConstructorDecl>::operator*() const
Line
Count
Source
2055
8.64k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl>::operator*() const
Line
Count
Source
2055
34.1k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::ObjCImplementationDecl>::operator*() const
Line
Count
Source
2055
104
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::NamespaceDecl>::operator*() const
Line
Count
Source
2055
6
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::FunctionTemplateDecl>::operator*() const
Line
Count
Source
2055
2
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::specific_decl_iterator<clang::VarDecl>::operator*() const
Line
Count
Source
2055
978k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
2056
2057
    // This doesn't meet the iterator requirements, but it's convenient
2058
2.57M
    value_type operator->() const { return **this; }
clang::DeclContext::specific_decl_iterator<clang::FieldDecl>::operator->() const
Line
Count
Source
2058
2.56M
    value_type operator->() const { return **this; }
clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl>::operator->() const
Line
Count
Source
2058
294
    value_type operator->() const { return **this; }
clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl>::operator->() const
Line
Count
Source
2058
87
    value_type operator->() const { return **this; }
clang::DeclContext::specific_decl_iterator<clang::ObjCImplementationDecl>::operator->() const
Line
Count
Source
2058
104
    value_type operator->() const { return **this; }
clang::DeclContext::specific_decl_iterator<clang::NamespaceDecl>::operator->() const
Line
Count
Source
2058
3
    value_type operator->() const { return **this; }
clang::DeclContext::specific_decl_iterator<clang::FunctionTemplateDecl>::operator->() const
Line
Count
Source
2058
2
    value_type operator->() const { return **this; }
clang::DeclContext::specific_decl_iterator<clang::CXXMethodDecl>::operator->() const
Line
Count
Source
2058
5.11k
    value_type operator->() const { return **this; }
2059
2060
20.5M
    specific_decl_iterator& operator++() {
2061
20.5M
      ++Current;
2062
20.5M
      SkipToNextDecl();
2063
20.5M
      return *this;
2064
20.5M
    }
clang::DeclContext::specific_decl_iterator<clang::FieldDecl>::operator++()
Line
Count
Source
2060
9.54M
    specific_decl_iterator& operator++() {
2061
9.54M
      ++Current;
2062
9.54M
      SkipToNextDecl();
2063
9.54M
      return *this;
2064
9.54M
    }
clang::DeclContext::specific_decl_iterator<clang::CXXMethodDecl>::operator++()
Line
Count
Source
2060
9.86M
    specific_decl_iterator& operator++() {
2061
9.86M
      ++Current;
2062
9.86M
      SkipToNextDecl();
2063
9.86M
      return *this;
2064
9.86M
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyDecl>::operator++()
Line
Count
Source
2060
32.9k
    specific_decl_iterator& operator++() {
2061
32.9k
      ++Current;
2062
32.9k
      SkipToNextDecl();
2063
32.9k
      return *this;
2064
32.9k
    }
clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl>::operator++()
Line
Count
Source
2060
102k
    specific_decl_iterator& operator++() {
2061
102k
      ++Current;
2062
102k
      SkipToNextDecl();
2063
102k
      return *this;
2064
102k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyImplDecl>::operator++()
Line
Count
Source
2060
37.2k
    specific_decl_iterator& operator++() {
2061
37.2k
      ++Current;
2062
37.2k
      SkipToNextDecl();
2063
37.2k
      return *this;
2064
37.2k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl>::operator++()
Line
Count
Source
2060
5.20k
    specific_decl_iterator& operator++() {
2061
5.20k
      ++Current;
2062
5.20k
      SkipToNextDecl();
2063
5.20k
      return *this;
2064
5.20k
    }
clang::DeclContext::specific_decl_iterator<clang::CXXConstructorDecl>::operator++()
Line
Count
Source
2060
7.21k
    specific_decl_iterator& operator++() {
2061
7.21k
      ++Current;
2062
7.21k
      SkipToNextDecl();
2063
7.21k
      return *this;
2064
7.21k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl>::operator++()
Line
Count
Source
2060
24.6k
    specific_decl_iterator& operator++() {
2061
24.6k
      ++Current;
2062
24.6k
      SkipToNextDecl();
2063
24.6k
      return *this;
2064
24.6k
    }
clang::DeclContext::specific_decl_iterator<clang::ObjCImplementationDecl>::operator++()
Line
Count
Source
2060
104
    specific_decl_iterator& operator++() {
2061
104
      ++Current;
2062
104
      SkipToNextDecl();
2063
104
      return *this;
2064
104
    }
clang::DeclContext::specific_decl_iterator<clang::NamespaceDecl>::operator++()
Line
Count
Source
2060
3
    specific_decl_iterator& operator++() {
2061
3
      ++Current;
2062
3
      SkipToNextDecl();
2063
3
      return *this;
2064
3
    }
Unexecuted instantiation: clang::DeclContext::specific_decl_iterator<clang::FunctionTemplateDecl>::operator++()
clang::DeclContext::specific_decl_iterator<clang::VarDecl>::operator++()
Line
Count
Source
2060
978k
    specific_decl_iterator& operator++() {
2061
978k
      ++Current;
2062
978k
      SkipToNextDecl();
2063
978k
      return *this;
2064
978k
    }
2065
2066
    specific_decl_iterator operator++(int) {
2067
      specific_decl_iterator tmp(*this);
2068
      ++(*this);
2069
      return tmp;
2070
    }
2071
2072
    friend bool operator==(const specific_decl_iterator& x,
2073
1.34M
                           const specific_decl_iterator& y) {
2074
1.34M
      return x.Current == y.Current;
2075
1.34M
    }
clang::operator==(clang::DeclContext::specific_decl_iterator<clang::FieldDecl> const&, clang::DeclContext::specific_decl_iterator<clang::FieldDecl> const&)
Line
Count
Source
2073
1.24M
                           const specific_decl_iterator& y) {
2074
1.24M
      return x.Current == y.Current;
2075
1.24M
    }
clang::operator==(clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl> const&, clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl> const&)
Line
Count
Source
2073
49.6k
                           const specific_decl_iterator& y) {
2074
49.6k
      return x.Current == y.Current;
2075
49.6k
    }
clang::operator==(clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl> const&, clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl> const&)
Line
Count
Source
2073
32
                           const specific_decl_iterator& y) {
2074
32
      return x.Current == y.Current;
2075
32
    }
clang::operator==(clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl> const&, clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl> const&)
Line
Count
Source
2073
45.6k
                           const specific_decl_iterator& y) {
2074
45.6k
      return x.Current == y.Current;
2075
45.6k
    }
2076
2077
    friend bool operator!=(const specific_decl_iterator& x,
2078
32.6M
                           const specific_decl_iterator& y) {
2079
32.6M
      return x.Current != y.Current;
2080
32.6M
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl> const&, clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl> const&)
Line
Count
Source
2078
44.8k
                           const specific_decl_iterator& y) {
2079
44.8k
      return x.Current != y.Current;
2080
44.8k
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::FieldDecl> const&, clang::DeclContext::specific_decl_iterator<clang::FieldDecl> const&)
Line
Count
Source
2078
14.5M
                           const specific_decl_iterator& y) {
2079
14.5M
      return x.Current != y.Current;
2080
14.5M
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::CXXMethodDecl> const&, clang::DeclContext::specific_decl_iterator<clang::CXXMethodDecl> const&)
Line
Count
Source
2078
16.1M
                           const specific_decl_iterator& y) {
2079
16.1M
      return x.Current != y.Current;
2080
16.1M
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyDecl> const&, clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyDecl> const&)
Line
Count
Source
2078
77.3k
                           const specific_decl_iterator& y) {
2079
77.3k
      return x.Current != y.Current;
2080
77.3k
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl> const&, clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl> const&)
Line
Count
Source
2078
113k
                           const specific_decl_iterator& y) {
2079
113k
      return x.Current != y.Current;
2080
113k
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyImplDecl> const&, clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyImplDecl> const&)
Line
Count
Source
2078
63.9k
                           const specific_decl_iterator& y) {
2079
63.9k
      return x.Current != y.Current;
2080
63.9k
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl> const&, clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl> const&)
Line
Count
Source
2078
8.06k
                           const specific_decl_iterator& y) {
2079
8.06k
      return x.Current != y.Current;
2080
8.06k
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::CXXConstructorDecl> const&, clang::DeclContext::specific_decl_iterator<clang::CXXConstructorDecl> const&)
Line
Count
Source
2078
11.3k
                           const specific_decl_iterator& y) {
2079
11.3k
      return x.Current != y.Current;
2080
11.3k
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::ObjCImplementationDecl> const&, clang::DeclContext::specific_decl_iterator<clang::ObjCImplementationDecl> const&)
Line
Count
Source
2078
193
                           const specific_decl_iterator& y) {
2079
193
      return x.Current != y.Current;
2080
193
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::NamespaceDecl> const&, clang::DeclContext::specific_decl_iterator<clang::NamespaceDecl> const&)
Line
Count
Source
2078
4
                           const specific_decl_iterator& y) {
2079
4
      return x.Current != y.Current;
2080
4
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::FunctionTemplateDecl> const&, clang::DeclContext::specific_decl_iterator<clang::FunctionTemplateDecl> const&)
Line
Count
Source
2078
2
                           const specific_decl_iterator& y) {
2079
2
      return x.Current != y.Current;
2080
2
    }
clang::operator!=(clang::DeclContext::specific_decl_iterator<clang::VarDecl> const&, clang::DeclContext::specific_decl_iterator<clang::VarDecl> const&)
Line
Count
Source
2078
1.60M
                           const specific_decl_iterator& y) {
2079
1.60M
      return x.Current != y.Current;
2080
1.60M
    }
2081
  };
2082
2083
  /// Iterates over a filtered subrange of declarations stored
2084
  /// in a DeclContext.
2085
  ///
2086
  /// This iterator visits only those declarations that are of type
2087
  /// SpecificDecl (or a class derived from it) and that meet some
2088
  /// additional run-time criteria. This iterator is used, for
2089
  /// example, to provide access to the instance methods within an
2090
  /// Objective-C interface (with SpecificDecl = ObjCMethodDecl and
2091
  /// Acceptable = ObjCMethodDecl::isInstanceMethod).
2092
  template<typename SpecificDecl, bool (SpecificDecl::*Acceptable)() const>
2093
  class filtered_decl_iterator {
2094
    /// Current - The current, underlying declaration iterator, which
2095
    /// will either be NULL or will point to a declaration of
2096
    /// type SpecificDecl.
2097
    DeclContext::decl_iterator Current;
2098
2099
    /// SkipToNextDecl - Advances the current position up to the next
2100
    /// declaration of type SpecificDecl that also meets the criteria
2101
    /// required by Acceptable.
2102
111k
    void SkipToNextDecl() {
2103
176k
      while (*Current &&
2104
176k
             
(102k
!isa<SpecificDecl>(*Current)102k
||
2105
102k
              
(68.7k
Acceptable68.7k
&&
!(cast<SpecificDecl>(*Current)->*Acceptable)()68.7k
)))
2106
64.3k
        ++Current;
2107
111k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isInstanceMethod() const)>::SkipToNextDecl()
Line
Count
Source
2102
68.8k
    void SkipToNextDecl() {
2103
90.7k
      while (*Current &&
2104
90.7k
             
(52.1k
!isa<SpecificDecl>(*Current)52.1k
||
2105
52.1k
              
(35.9k
Acceptable35.9k
&&
!(cast<SpecificDecl>(*Current)->*Acceptable)()35.9k
)))
2106
21.9k
        ++Current;
2107
68.8k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isClassMethod() const)>::SkipToNextDecl()
Line
Count
Source
2102
36.1k
    void SkipToNextDecl() {
2103
73.6k
      while (*Current &&
2104
73.6k
             
(42.1k
!isa<SpecificDecl>(*Current)42.1k
||
2105
42.1k
              
(29.6k
Acceptable29.6k
&&
!(cast<SpecificDecl>(*Current)->*Acceptable)()29.6k
)))
2106
37.5k
        ++Current;
2107
36.1k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isInstanceProperty() const)>::SkipToNextDecl()
Line
Count
Source
2102
6.33k
    void SkipToNextDecl() {
2103
11.1k
      while (*Current &&
2104
11.1k
             
(7.62k
!isa<SpecificDecl>(*Current)7.62k
||
2105
7.62k
              
(2.82k
Acceptable2.82k
&&
!(cast<SpecificDecl>(*Current)->*Acceptable)()2.82k
)))
2106
4.79k
        ++Current;
2107
6.33k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isClassProperty() const)>::SkipToNextDecl()
Line
Count
Source
2102
426
    void SkipToNextDecl() {
2103
598
      while (*Current &&
2104
598
             
(414
!isa<SpecificDecl>(*Current)414
||
2105
414
              
(342
Acceptable342
&&
!(cast<SpecificDecl>(*Current)->*Acceptable)()342
)))
2106
172
        ++Current;
2107
426
    }
2108
2109
  public:
2110
    using value_type = SpecificDecl *;
2111
    // TODO: Add reference and pointer types (with some appropriate proxy type)
2112
    // if we ever have a need for them.
2113
    using reference = void;
2114
    using pointer = void;
2115
    using difference_type =
2116
        std::iterator_traits<DeclContext::decl_iterator>::difference_type;
2117
    using iterator_category = std::forward_iterator_tag;
2118
2119
    filtered_decl_iterator() = default;
2120
2121
    /// filtered_decl_iterator - Construct a new iterator over a
2122
    /// subset of the declarations the range [C,
2123
    /// end-of-declarations). If A is non-NULL, it is a pointer to a
2124
    /// member function of SpecificDecl that should return true for
2125
    /// all of the SpecificDecl instances that will be in the subset
2126
    /// of iterators. For example, if you want Objective-C instance
2127
    /// methods, SpecificDecl will be ObjCMethodDecl and A will be
2128
    /// &ObjCMethodDecl::isInstanceMethod.
2129
75.3k
    explicit filtered_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2130
75.3k
      SkipToNextDecl();
2131
75.3k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isInstanceMethod() const)>::filtered_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2129
38.8k
    explicit filtered_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2130
38.8k
      SkipToNextDecl();
2131
38.8k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isClassMethod() const)>::filtered_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2129
31.5k
    explicit filtered_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2130
31.5k
      SkipToNextDecl();
2131
31.5k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isInstanceProperty() const)>::filtered_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2129
4.64k
    explicit filtered_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2130
4.64k
      SkipToNextDecl();
2131
4.64k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isClassProperty() const)>::filtered_decl_iterator(clang::DeclContext::decl_iterator)
Line
Count
Source
2129
354
    explicit filtered_decl_iterator(DeclContext::decl_iterator C) : Current(C) {
2130
354
      SkipToNextDecl();
2131
354
    }
2132
2133
37.8k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isInstanceMethod() const)>::operator*() const
Line
Count
Source
2133
30.1k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isClassMethod() const)>::operator*() const
Line
Count
Source
2133
4.63k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isInstanceProperty() const)>::operator*() const
Line
Count
Source
2133
2.81k
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isClassProperty() const)>::operator*() const
Line
Count
Source
2133
242
    value_type operator*() const { return cast<SpecificDecl>(*Current); }
2134
    value_type operator->() const { return cast<SpecificDecl>(*Current); }
2135
2136
36.3k
    filtered_decl_iterator& operator++() {
2137
36.3k
      ++Current;
2138
36.3k
      SkipToNextDecl();
2139
36.3k
      return *this;
2140
36.3k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isInstanceMethod() const)>::operator++()
Line
Count
Source
2136
29.9k
    filtered_decl_iterator& operator++() {
2137
29.9k
      ++Current;
2138
29.9k
      SkipToNextDecl();
2139
29.9k
      return *this;
2140
29.9k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isClassMethod() const)>::operator++()
Line
Count
Source
2136
4.63k
    filtered_decl_iterator& operator++() {
2137
4.63k
      ++Current;
2138
4.63k
      SkipToNextDecl();
2139
4.63k
      return *this;
2140
4.63k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isInstanceProperty() const)>::operator++()
Line
Count
Source
2136
1.68k
    filtered_decl_iterator& operator++() {
2137
1.68k
      ++Current;
2138
1.68k
      SkipToNextDecl();
2139
1.68k
      return *this;
2140
1.68k
    }
clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isClassProperty() const)>::operator++()
Line
Count
Source
2136
72
    filtered_decl_iterator& operator++() {
2137
72
      ++Current;
2138
72
      SkipToNextDecl();
2139
72
      return *this;
2140
72
    }
2141
2142
    filtered_decl_iterator operator++(int) {
2143
      filtered_decl_iterator tmp(*this);
2144
      ++(*this);
2145
      return tmp;
2146
    }
2147
2148
    friend bool operator==(const filtered_decl_iterator& x,
2149
79
                           const filtered_decl_iterator& y) {
2150
79
      return x.Current == y.Current;
2151
79
    }
clang::operator==(clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isClassMethod() const)> const&, clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isClassMethod() const)> const&)
Line
Count
Source
2149
75
                           const filtered_decl_iterator& y) {
2150
75
      return x.Current == y.Current;
2151
75
    }
clang::operator==(clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isInstanceMethod() const)> const&, clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isInstanceMethod() const)> const&)
Line
Count
Source
2149
4
                           const filtered_decl_iterator& y) {
2150
4
      return x.Current == y.Current;
2151
4
    }
2152
2153
    friend bool operator!=(const filtered_decl_iterator& x,
2154
74.3k
                           const filtered_decl_iterator& y) {
2155
74.3k
      return x.Current != y.Current;
2156
74.3k
    }
clang::operator!=(clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isInstanceMethod() const)> const&, clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isInstanceMethod() const)> const&)
Line
Count
Source
2154
49.5k
                           const filtered_decl_iterator& y) {
2155
49.5k
      return x.Current != y.Current;
2156
49.5k
    }
clang::operator!=(clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isClassMethod() const)> const&, clang::DeclContext::filtered_decl_iterator<clang::ObjCMethodDecl, &(clang::ObjCMethodDecl::isClassMethod() const)> const&)
Line
Count
Source
2154
20.4k
                           const filtered_decl_iterator& y) {
2155
20.4k
      return x.Current != y.Current;
2156
20.4k
    }
clang::operator!=(clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isInstanceProperty() const)> const&, clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isInstanceProperty() const)> const&)
Line
Count
Source
2154
4.11k
                           const filtered_decl_iterator& y) {
2155
4.11k
      return x.Current != y.Current;
2156
4.11k
    }
clang::operator!=(clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isClassProperty() const)> const&, clang::DeclContext::filtered_decl_iterator<clang::ObjCPropertyDecl, &(clang::ObjCPropertyDecl::isClassProperty() const)> const&)
Line
Count
Source
2154
249
                           const filtered_decl_iterator& y) {
2155
249
      return x.Current != y.Current;
2156
249
    }
2157
  };
2158
2159
  /// Add the declaration D into this context.
2160
  ///
2161
  /// This routine should be invoked when the declaration D has first
2162
  /// been declared, to place D into the context where it was
2163
  /// (lexically) defined. Every declaration must be added to one
2164
  /// (and only one!) context, where it can be visited via
2165
  /// [decls_begin(), decls_end()). Once a declaration has been added
2166
  /// to its lexical context, the corresponding DeclContext owns the
2167
  /// declaration.
2168
  ///
2169
  /// If D is also a NamedDecl, it will be made visible within its
2170
  /// semantic context via makeDeclVisibleInContext.
2171
  void addDecl(Decl *D);
2172
2173
  /// Add the declaration D into this context, but suppress
2174
  /// searches for external declarations with the same name.
2175
  ///
2176
  /// Although analogous in function to addDecl, this removes an
2177
  /// important check.  This is only useful if the Decl is being
2178
  /// added in response to an external search; in all other cases,
2179
  /// addDecl() is the right function to use.
2180
  /// See the ASTImporter for use cases.
2181
  void addDeclInternal(Decl *D);
2182
2183
  /// Add the declaration D to this context without modifying
2184
  /// any lookup tables.
2185
  ///
2186
  /// This is useful for some operations in dependent contexts where
2187
  /// the semantic context might not be dependent;  this basically
2188
  /// only happens with friends.
2189
  void addHiddenDecl(Decl *D);
2190
2191
  /// Removes a declaration from this context.
2192
  void removeDecl(Decl *D);
2193
2194
  /// Checks whether a declaration is in this context.
2195
  bool containsDecl(Decl *D) const;
2196
2197
  /// Checks whether a declaration is in this context.
2198
  /// This also loads the Decls from the external source before the check.
2199
  bool containsDeclAndLoad(Decl *D) const;
2200
2201
  using lookup_result = DeclContextLookupResult;
2202
  using lookup_iterator = lookup_result::iterator;
2203
2204
  /// lookup - Find the declarations (if any) with the given Name in
2205
  /// this context. Returns a range of iterators that contains all of
2206
  /// the declarations with this name, with object, function, member,
2207
  /// and enumerator names preceding any tag name. Note that this
2208
  /// routine will not look into parent contexts.
2209
  lookup_result lookup(DeclarationName Name) const;
2210
2211
  /// Find the declarations with the given name that are visible
2212
  /// within this context; don't attempt to retrieve anything from an
2213
  /// external source.
2214
  lookup_result noload_lookup(DeclarationName Name);
2215
2216
  /// A simplistic name lookup mechanism that performs name lookup
2217
  /// into this declaration context without consulting the external source.
2218
  ///
2219
  /// This function should almost never be used, because it subverts the
2220
  /// usual relationship between a DeclContext and the external source.
2221
  /// See the ASTImporter for the (few, but important) use cases.
2222
  ///
2223
  /// FIXME: This is very inefficient; replace uses of it with uses of
2224
  /// noload_lookup.
2225
  void localUncachedLookup(DeclarationName Name,
2226
                           SmallVectorImpl<NamedDecl *> &Results);
2227
2228
  /// Makes a declaration visible within this context.
2229
  ///
2230
  /// This routine makes the declaration D visible to name lookup
2231
  /// within this context and, if this is a transparent context,
2232
  /// within its parent contexts up to the first enclosing
2233
  /// non-transparent context. Making a declaration visible within a
2234
  /// context does not transfer ownership of a declaration, and a
2235
  /// declaration can be visible in many contexts that aren't its
2236
  /// lexical context.
2237
  ///
2238
  /// If D is a redeclaration of an existing declaration that is
2239
  /// visible from this context, as determined by
2240
  /// NamedDecl::declarationReplaces, the previous declaration will be
2241
  /// replaced with D.
2242
  void makeDeclVisibleInContext(NamedDecl *D);
2243
2244
  /// all_lookups_iterator - An iterator that provides a view over the results
2245
  /// of looking up every possible name.
2246
  class all_lookups_iterator;
2247
2248
  using lookups_range = llvm::iterator_range<all_lookups_iterator>;
2249
2250
  lookups_range lookups() const;
2251
  // Like lookups(), but avoids loading external declarations.
2252
  // If PreserveInternalState, avoids building lookup data structures too.
2253
  lookups_range noload_lookups(bool PreserveInternalState) const;
2254
2255
  /// Iterators over all possible lookups within this context.
2256
  all_lookups_iterator lookups_begin() const;
2257
  all_lookups_iterator lookups_end() const;
2258
2259
  /// Iterators over all possible lookups within this context that are
2260
  /// currently loaded; don't attempt to retrieve anything from an external
2261
  /// source.
2262
  all_lookups_iterator noload_lookups_begin() const;
2263
  all_lookups_iterator noload_lookups_end() const;
2264
2265
  struct udir_iterator;
2266
2267
  using udir_iterator_base =
2268
      llvm::iterator_adaptor_base<udir_iterator, lookup_iterator,
2269
                                  std::random_access_iterator_tag,
2270
                                  UsingDirectiveDecl *>;
2271
2272
  struct udir_iterator : udir_iterator_base {
2273
199M
    udir_iterator(lookup_iterator I) : udir_iterator_base(I) {}
2274
2275
    UsingDirectiveDecl *operator*() const;
2276
  };
2277
2278
  using udir_range = llvm::iterator_range<udir_iterator>;
2279
2280
  udir_range using_directives() const;
2281
2282
  // These are all defined in DependentDiagnostic.h.
2283
  class ddiag_iterator;
2284
2285
  using ddiag_range = llvm::iterator_range<DeclContext::ddiag_iterator>;
2286
2287
  inline ddiag_range ddiags() const;
2288
2289
  // Low-level accessors
2290
2291
  /// Mark that there are external lexical declarations that we need
2292
  /// to include in our lookup table (and that are not available as external
2293
  /// visible lookups). These extra lookup results will be found by walking
2294
  /// the lexical declarations of this context. This should be used only if
2295
  /// setHasExternalLexicalStorage() has been called on any decl context for
2296
  /// which this is the primary context.
2297
2.01k
  void setMustBuildLookupTable() {
2298
2.01k
    assert(this == getPrimaryContext() &&
2299
2.01k
           "should only be called on primary context");
2300
2.01k
    DeclContextBits.HasLazyExternalLexicalLookups = true;
2301
2.01k
  }
2302
2303
  /// Retrieve the internal representation of the lookup structure.
2304
  /// This may omit some names if we are lazily building the structure.
2305
1.73M
  StoredDeclsMap *getLookupPtr() const { return LookupPtr; }
2306
2307
  /// Ensure the lookup structure is fully-built and return it.
2308
  StoredDeclsMap *buildLookup();
2309
2310
  /// Whether this DeclContext has external storage containing
2311
  /// additional declarations that are lexically in this context.
2312
31.7M
  bool hasExternalLexicalStorage() const {
2313
31.7M
    return DeclContextBits.ExternalLexicalStorage;
2314
31.7M
  }
2315
2316
  /// State whether this DeclContext has external storage for
2317
  /// declarations lexically in this context.
2318
17.5M
  void setHasExternalLexicalStorage(bool ES = true) const {
2319
17.5M
    DeclContextBits.ExternalLexicalStorage = ES;
2320
17.5M
  }
2321
2322
  /// Whether this DeclContext has external storage containing
2323
  /// additional declarations that are visible in this context.
2324
227M
  bool hasExternalVisibleStorage() const {
2325
227M
    return DeclContextBits.ExternalVisibleStorage;
2326
227M
  }
2327
2328
  /// State whether this DeclContext has external storage for
2329
  /// declarations visible in this context.
2330
17.4M
  void setHasExternalVisibleStorage(bool ES = true) const {
2331
17.4M
    DeclContextBits.ExternalVisibleStorage = ES;
2332
17.4M
    if (ES && 
LookupPtr11.5k
)
2333
933
      DeclContextBits.NeedToReconcileExternalVisibleStorage = true;
2334
17.4M
  }
2335
2336
  /// Determine whether the given declaration is stored in the list of
2337
  /// declarations lexically within this context.
2338
28.9k
  bool isDeclInLexicalTraversal(const Decl *D) const {
2339
28.9k
    return D && (D->NextInContextAndBits.getPointer() || 
D == FirstDecl28.4k
||
2340
28.9k
                 
D == LastDecl28.0k
);
2341
28.9k
  }
2342
2343
87.1M
  bool setUseQualifiedLookup(bool use = true) const {
2344
87.1M
    bool old_value = DeclContextBits.UseQualifiedLookup;
2345
87.1M
    DeclContextBits.UseQualifiedLookup = use;
2346
87.1M
    return old_value;
2347
87.1M
  }
2348
2349
0
  bool shouldUseQualifiedLookup() const {
2350
0
    return DeclContextBits.UseQualifiedLookup;
2351
0
  }
2352
2353
  static bool classof(const Decl *D);
2354
0
  static bool classof(const DeclContext *D) { return true; }
2355
2356
  void dumpDeclContext() const;
2357
  void dumpLookups() const;
2358
  void dumpLookups(llvm::raw_ostream &OS, bool DumpDecls = false,
2359
                   bool Deserialize = false) const;
2360
2361
private:
2362
  /// Whether this declaration context has had externally visible
2363
  /// storage added since the last lookup. In this case, \c LookupPtr's
2364
  /// invariant may not hold and needs to be fixed before we perform
2365
  /// another lookup.
2366
108k
  bool hasNeedToReconcileExternalVisibleStorage() const {
2367
108k
    return DeclContextBits.NeedToReconcileExternalVisibleStorage;
2368
108k
  }
2369
2370
  /// State that this declaration context has had externally visible
2371
  /// storage added since the last lookup. In this case, \c LookupPtr's
2372
  /// invariant may not hold and needs to be fixed before we perform
2373
  /// another lookup.
2374
17.4M
  void setNeedToReconcileExternalVisibleStorage(bool Need = true) const {
2375
17.4M
    DeclContextBits.NeedToReconcileExternalVisibleStorage = Need;
2376
17.4M
  }
2377
2378
  /// If \c true, this context may have local lexical declarations
2379
  /// that are missing from the lookup table.
2380
235M
  bool hasLazyLocalLexicalLookups() const {
2381
235M
    return DeclContextBits.HasLazyLocalLexicalLookups;
2382
235M
  }
2383
2384
  /// If \c true, this context may have local lexical declarations
2385
  /// that are missing from the lookup table.
2386
28.5M
  void setHasLazyLocalLexicalLookups(bool HasLLLL = true) const {
2387
28.5M
    DeclContextBits.HasLazyLocalLexicalLookups = HasLLLL;
2388
28.5M
  }
2389
2390
  /// If \c true, the external source may have lexical declarations
2391
  /// that are missing from the lookup table.
2392
232M
  bool hasLazyExternalLexicalLookups() const {
2393
232M
    return DeclContextBits.HasLazyExternalLexicalLookups;
2394
232M
  }
2395
2396
  /// If \c true, the external source may have lexical declarations
2397
  /// that are missing from the lookup table.
2398
17.4M
  void setHasLazyExternalLexicalLookups(bool HasLELL = true) const {
2399
17.4M
    DeclContextBits.HasLazyExternalLexicalLookups = HasLELL;
2400
17.4M
  }
2401
2402
  void reconcileExternalVisibleStorage() const;
2403
  bool LoadLexicalDeclsFromExternalStorage() const;
2404
2405
  /// Makes a declaration visible within this context, but
2406
  /// suppresses searches for external declarations with the same
2407
  /// name.
2408
  ///
2409
  /// Analogous to makeDeclVisibleInContext, but for the exclusive
2410
  /// use of addDeclInternal().
2411
  void makeDeclVisibleInContextInternal(NamedDecl *D);
2412
2413
  StoredDeclsMap *CreateStoredDeclsMap(ASTContext &C) const;
2414
2415
  void loadLazyLocalLexicalLookups();
2416
  void buildLookupImpl(DeclContext *DCtx, bool Internal);
2417
  void makeDeclVisibleInContextWithFlags(NamedDecl *D, bool Internal,
2418
                                         bool Rediscoverable);
2419
  void makeDeclVisibleInContextImpl(NamedDecl *D, bool Internal);
2420
};
2421
2422
30.8M
inline bool Decl::isTemplateParameter() const {
2423
30.8M
  return getKind() == TemplateTypeParm || 
getKind() == NonTypeTemplateParm30.8M
||
2424
30.8M
         
getKind() == TemplateTemplateParm30.8M
;
2425
30.8M
}
2426
2427
// Specialization selected when ToTy is not a known subclass of DeclContext.
2428
template <class ToTy,
2429
          bool IsKnownSubtype = ::std::is_base_of<DeclContext, ToTy>::value>
2430
struct cast_convert_decl_context {
2431
295M
  static const ToTy *doit(const DeclContext *Val) {
2432
295M
    return static_cast<const ToTy*>(Decl::castFromDeclContext(Val));
2433
295M
  }
clang::cast_convert_decl_context<clang::Decl, false>::doit(clang::DeclContext const*)
Line
Count
Source
2431
290M
  static const ToTy *doit(const DeclContext *Val) {
2432
290M
    return static_cast<const ToTy*>(Decl::castFromDeclContext(Val));
2433
290M
  }
clang::cast_convert_decl_context<clang::NamedDecl, false>::doit(clang::DeclContext const*)
Line
Count
Source
2431
4.59M
  static const ToTy *doit(const DeclContext *Val) {
2432
4.59M
    return static_cast<const ToTy*>(Decl::castFromDeclContext(Val));
2433
4.59M
  }
clang::cast_convert_decl_context<clang::TypeDecl, false>::doit(clang::DeclContext const*)
Line
Count
Source
2431
103
  static const ToTy *doit(const DeclContext *Val) {
2432
103
    return static_cast<const ToTy*>(Decl::castFromDeclContext(Val));
2433
103
  }
Unexecuted instantiation: clang::cast_convert_decl_context<clang::TypedefNameDecl, false>::doit(clang::DeclContext const*)
2434
2435
1.89G
  static ToTy *doit(DeclContext *Val) {
2436
1.89G
    return static_cast<ToTy*>(Decl::castFromDeclContext(Val));
2437
1.89G
  }
clang::cast_convert_decl_context<clang::Decl, false>::doit(clang::DeclContext*)
Line
Count
Source
2435
1.88G
  static ToTy *doit(DeclContext *Val) {
2436
1.88G
    return static_cast<ToTy*>(Decl::castFromDeclContext(Val));
2437
1.88G
  }
clang::cast_convert_decl_context<clang::NamedDecl, false>::doit(clang::DeclContext*)
Line
Count
Source
2435
3.21M
  static ToTy *doit(DeclContext *Val) {
2436
3.21M
    return static_cast<ToTy*>(Decl::castFromDeclContext(Val));
2437
3.21M
  }
clang::cast_convert_decl_context<clang::TypeDecl, false>::doit(clang::DeclContext*)
Line
Count
Source
2435
5.02k
  static ToTy *doit(DeclContext *Val) {
2436
5.02k
    return static_cast<ToTy*>(Decl::castFromDeclContext(Val));
2437
5.02k
  }
2438
};
2439
2440
// Specialization selected when ToTy is a known subclass of DeclContext.
2441
template <class ToTy>
2442
struct cast_convert_decl_context<ToTy, true> {
2443
293M
  static const ToTy *doit(const DeclContext *Val) {
2444
293M
    return static_cast<const ToTy*>(Val);
2445
293M
  }
clang::cast_convert_decl_context<clang::CXXRecordDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
147M
  static const ToTy *doit(const DeclContext *Val) {
2444
147M
    return static_cast<const ToTy*>(Val);
2445
147M
  }
clang::cast_convert_decl_context<clang::RecordDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
11.9M
  static const ToTy *doit(const DeclContext *Val) {
2444
11.9M
    return static_cast<const ToTy*>(Val);
2445
11.9M
  }
clang::cast_convert_decl_context<clang::ObjCCategoryDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
2.88k
  static const ToTy *doit(const DeclContext *Val) {
2444
2.88k
    return static_cast<const ToTy*>(Val);
2445
2.88k
  }
clang::cast_convert_decl_context<clang::ObjCImplementationDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
67
  static const ToTy *doit(const DeclContext *Val) {
2444
67
    return static_cast<const ToTy*>(Val);
2445
67
  }
clang::cast_convert_decl_context<clang::ObjCInterfaceDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
47.7k
  static const ToTy *doit(const DeclContext *Val) {
2444
47.7k
    return static_cast<const ToTy*>(Val);
2445
47.7k
  }
clang::cast_convert_decl_context<clang::ObjCCategoryImplDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
71
  static const ToTy *doit(const DeclContext *Val) {
2444
71
    return static_cast<const ToTy*>(Val);
2445
71
  }
clang::cast_convert_decl_context<clang::NamespaceDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
19.6M
  static const ToTy *doit(const DeclContext *Val) {
2444
19.6M
    return static_cast<const ToTy*>(Val);
2445
19.6M
  }
clang::cast_convert_decl_context<clang::EnumDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
2.02M
  static const ToTy *doit(const DeclContext *Val) {
2444
2.02M
    return static_cast<const ToTy*>(Val);
2445
2.02M
  }
clang::cast_convert_decl_context<clang::CapturedDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
1.86k
  static const ToTy *doit(const DeclContext *Val) {
2444
1.86k
    return static_cast<const ToTy*>(Val);
2445
1.86k
  }
clang::cast_convert_decl_context<clang::FunctionDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
52.2M
  static const ToTy *doit(const DeclContext *Val) {
2444
52.2M
    return static_cast<const ToTy*>(Val);
2445
52.2M
  }
clang::cast_convert_decl_context<clang::BlockDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
113
  static const ToTy *doit(const DeclContext *Val) {
2444
113
    return static_cast<const ToTy*>(Val);
2445
113
  }
clang::cast_convert_decl_context<clang::ObjCMethodDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
389
  static const ToTy *doit(const DeclContext *Val) {
2444
389
    return static_cast<const ToTy*>(Val);
2445
389
  }
clang::cast_convert_decl_context<clang::ObjCImplDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
341
  static const ToTy *doit(const DeclContext *Val) {
2444
341
    return static_cast<const ToTy*>(Val);
2445
341
  }
clang::cast_convert_decl_context<clang::LinkageSpecDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
15.5M
  static const ToTy *doit(const DeclContext *Val) {
2444
15.5M
    return static_cast<const ToTy*>(Val);
2445
15.5M
  }
clang::cast_convert_decl_context<clang::ObjCContainerDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
6.53k
  static const ToTy *doit(const DeclContext *Val) {
2444
6.53k
    return static_cast<const ToTy*>(Val);
2445
6.53k
  }
clang::cast_convert_decl_context<clang::ObjCProtocolDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
1.09k
  static const ToTy *doit(const DeclContext *Val) {
2444
1.09k
    return static_cast<const ToTy*>(Val);
2445
1.09k
  }
clang::cast_convert_decl_context<clang::TagDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
478
  static const ToTy *doit(const DeclContext *Val) {
2444
478
    return static_cast<const ToTy*>(Val);
2445
478
  }
clang::cast_convert_decl_context<clang::CXXMethodDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
21.3M
  static const ToTy *doit(const DeclContext *Val) {
2444
21.3M
    return static_cast<const ToTy*>(Val);
2445
21.3M
  }
clang::cast_convert_decl_context<clang::TranslationUnitDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
23.3M
  static const ToTy *doit(const DeclContext *Val) {
2444
23.3M
    return static_cast<const ToTy*>(Val);
2445
23.3M
  }
clang::cast_convert_decl_context<clang::ClassTemplateSpecializationDecl, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
6.48k
  static const ToTy *doit(const DeclContext *Val) {
2444
6.48k
    return static_cast<const ToTy*>(Val);
2445
6.48k
  }
Unexecuted instantiation: clang::cast_convert_decl_context<clang::ObjCProtocolDecl const, true>::doit(clang::DeclContext const*)
clang::cast_convert_decl_context<clang::ObjCInterfaceDecl const, true>::doit(clang::DeclContext const*)
Line
Count
Source
2443
67
  static const ToTy *doit(const DeclContext *Val) {
2444
67
    return static_cast<const ToTy*>(Val);
2445
67
  }
Unexecuted instantiation: clang::cast_convert_decl_context<clang::CXXConstructorDecl, true>::doit(clang::DeclContext const*)
Unexecuted instantiation: clang::cast_convert_decl_context<clang::CXXDestructorDecl, true>::doit(clang::DeclContext const*)
2446
2447
1.31G
  static ToTy *doit(DeclContext *Val) {
2448
1.31G
    return static_cast<ToTy*>(Val);
2449
1.31G
  }
clang::cast_convert_decl_context<clang::CXXRecordDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
134M
  static ToTy *doit(DeclContext *Val) {
2448
134M
    return static_cast<ToTy*>(Val);
2449
134M
  }
clang::cast_convert_decl_context<clang::RecordDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
1.64M
  static ToTy *doit(DeclContext *Val) {
2448
1.64M
    return static_cast<ToTy*>(Val);
2449
1.64M
  }
clang::cast_convert_decl_context<clang::FunctionDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
26.6M
  static ToTy *doit(DeclContext *Val) {
2448
26.6M
    return static_cast<ToTy*>(Val);
2449
26.6M
  }
clang::cast_convert_decl_context<clang::TagDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
288M
  static ToTy *doit(DeclContext *Val) {
2448
288M
    return static_cast<ToTy*>(Val);
2449
288M
  }
clang::cast_convert_decl_context<clang::ObjCContainerDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
312k
  static ToTy *doit(DeclContext *Val) {
2448
312k
    return static_cast<ToTy*>(Val);
2449
312k
  }
clang::cast_convert_decl_context<clang::ObjCCategoryImplDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
6
  static ToTy *doit(DeclContext *Val) {
2448
6
    return static_cast<ToTy*>(Val);
2449
6
  }
clang::cast_convert_decl_context<clang::ObjCImplDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
44.0k
  static ToTy *doit(DeclContext *Val) {
2448
44.0k
    return static_cast<ToTy*>(Val);
2449
44.0k
  }
clang::cast_convert_decl_context<clang::NamespaceDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
733k
  static ToTy *doit(DeclContext *Val) {
2448
733k
    return static_cast<ToTy*>(Val);
2449
733k
  }
clang::cast_convert_decl_context<clang::EnumDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
71.9k
  static ToTy *doit(DeclContext *Val) {
2448
71.9k
    return static_cast<ToTy*>(Val);
2449
71.9k
  }
clang::cast_convert_decl_context<clang::TranslationUnitDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
815M
  static ToTy *doit(DeclContext *Val) {
2448
815M
    return static_cast<ToTy*>(Val);
2449
815M
  }
clang::cast_convert_decl_context<clang::CXXMethodDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
45.8M
  static ToTy *doit(DeclContext *Val) {
2448
45.8M
    return static_cast<ToTy*>(Val);
2449
45.8M
  }
clang::cast_convert_decl_context<clang::ObjCMethodDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
31.6k
  static ToTy *doit(DeclContext *Val) {
2448
31.6k
    return static_cast<ToTy*>(Val);
2449
31.6k
  }
clang::cast_convert_decl_context<clang::CXXConstructorDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
12.0k
  static ToTy *doit(DeclContext *Val) {
2448
12.0k
    return static_cast<ToTy*>(Val);
2449
12.0k
  }
clang::cast_convert_decl_context<clang::BlockDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
779
  static ToTy *doit(DeclContext *Val) {
2448
779
    return static_cast<ToTy*>(Val);
2449
779
  }
clang::cast_convert_decl_context<clang::ObjCInterfaceDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
375k
  static ToTy *doit(DeclContext *Val) {
2448
375k
    return static_cast<ToTy*>(Val);
2449
375k
  }
clang::cast_convert_decl_context<clang::ObjCCategoryDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
37.5k
  static ToTy *doit(DeclContext *Val) {
2448
37.5k
    return static_cast<ToTy*>(Val);
2449
37.5k
  }
clang::cast_convert_decl_context<clang::LinkageSpecDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
1.17M
  static ToTy *doit(DeclContext *Val) {
2448
1.17M
    return static_cast<ToTy*>(Val);
2449
1.17M
  }
clang::cast_convert_decl_context<clang::ObjCProtocolDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
145k
  static ToTy *doit(DeclContext *Val) {
2448
145k
    return static_cast<ToTy*>(Val);
2449
145k
  }
clang::cast_convert_decl_context<clang::OMPDeclareReductionDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
1.59k
  static ToTy *doit(DeclContext *Val) {
2448
1.59k
    return static_cast<ToTy*>(Val);
2449
1.59k
  }
clang::cast_convert_decl_context<clang::ClassTemplateSpecializationDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
2.89M
  static ToTy *doit(DeclContext *Val) {
2448
2.89M
    return static_cast<ToTy*>(Val);
2449
2.89M
  }
clang::cast_convert_decl_context<clang::CapturedDecl, true>::doit(clang::DeclContext*)
Line
Count
Source
2447
24.0k
  static ToTy *doit(DeclContext *Val) {
2448
24.0k
    return static_cast<ToTy*>(Val);
2449
24.0k
  }
2450
};
2451
2452
} // namespace clang
2453
2454
namespace llvm {
2455
2456
/// isa<T>(DeclContext*)
2457
template <typename To>
2458
struct isa_impl<To, ::clang::DeclContext> {
2459
1.49G
  static bool doit(const ::clang::DeclContext &Val) {
2460
1.49G
    return To::classofKind(Val.getDeclKind());
2461
1.49G
  }
llvm::isa_impl<clang::ObjCCategoryDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
231k
  static bool doit(const ::clang::DeclContext &Val) {
2460
231k
    return To::classofKind(Val.getDeclKind());
2461
231k
  }
llvm::isa_impl<clang::FunctionDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
232M
  static bool doit(const ::clang::DeclContext &Val) {
2460
232M
    return To::classofKind(Val.getDeclKind());
2461
232M
  }
llvm::isa_impl<clang::CXXRecordDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
311M
  static bool doit(const ::clang::DeclContext &Val) {
2460
311M
    return To::classofKind(Val.getDeclKind());
2461
311M
  }
llvm::isa_impl<clang::ObjCImplementationDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
16.8k
  static bool doit(const ::clang::DeclContext &Val) {
2460
16.8k
    return To::classofKind(Val.getDeclKind());
2461
16.8k
  }
llvm::isa_impl<clang::ObjCInterfaceDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
200k
  static bool doit(const ::clang::DeclContext &Val) {
2460
200k
    return To::classofKind(Val.getDeclKind());
2461
200k
  }
llvm::isa_impl<clang::ObjCCategoryImplDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
2.82k
  static bool doit(const ::clang::DeclContext &Val) {
2460
2.82k
    return To::classofKind(Val.getDeclKind());
2461
2.82k
  }
llvm::isa_impl<clang::ObjCProtocolDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
154k
  static bool doit(const ::clang::DeclContext &Val) {
2460
154k
    return To::classofKind(Val.getDeclKind());
2461
154k
  }
llvm::isa_impl<clang::NamespaceDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
20.2M
  static bool doit(const ::clang::DeclContext &Val) {
2460
20.2M
    return To::classofKind(Val.getDeclKind());
2461
20.2M
  }
llvm::isa_impl<clang::RecordDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
37.7M
  static bool doit(const ::clang::DeclContext &Val) {
2460
37.7M
    return To::classofKind(Val.getDeclKind());
2461
37.7M
  }
llvm::isa_impl<clang::ObjCMethodDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
63.3M
  static bool doit(const ::clang::DeclContext &Val) {
2460
63.3M
    return To::classofKind(Val.getDeclKind());
2461
63.3M
  }
llvm::isa_impl<clang::Decl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
2.07M
  static bool doit(const ::clang::DeclContext &Val) {
2460
2.07M
    return To::classofKind(Val.getDeclKind());
2461
2.07M
  }
llvm::isa_impl<clang::CapturedDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
111M
  static bool doit(const ::clang::DeclContext &Val) {
2460
111M
    return To::classofKind(Val.getDeclKind());
2461
111M
  }
llvm::isa_impl<clang::BlockDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
78.9M
  static bool doit(const ::clang::DeclContext &Val) {
2460
78.9M
    return To::classofKind(Val.getDeclKind());
2461
78.9M
  }
llvm::isa_impl<clang::TranslationUnitDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
75.9M
  static bool doit(const ::clang::DeclContext &Val) {
2460
75.9M
    return To::classofKind(Val.getDeclKind());
2461
75.9M
  }
llvm::isa_impl<clang::TagDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
8.38M
  static bool doit(const ::clang::DeclContext &Val) {
2460
8.38M
    return To::classofKind(Val.getDeclKind());
2461
8.38M
  }
llvm::isa_impl<clang::LinkageSpecDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
43.6M
  static bool doit(const ::clang::DeclContext &Val) {
2460
43.6M
    return To::classofKind(Val.getDeclKind());
2461
43.6M
  }
llvm::isa_impl<clang::ObjCContainerDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
13.4M
  static bool doit(const ::clang::DeclContext &Val) {
2460
13.4M
    return To::classofKind(Val.getDeclKind());
2461
13.4M
  }
llvm::isa_impl<clang::ObjCImplDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
65.8k
  static bool doit(const ::clang::DeclContext &Val) {
2460
65.8k
    return To::classofKind(Val.getDeclKind());
2461
65.8k
  }
llvm::isa_impl<clang::NamedDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
3.56M
  static bool doit(const ::clang::DeclContext &Val) {
2460
3.56M
    return To::classofKind(Val.getDeclKind());
2461
3.56M
  }
llvm::isa_impl<clang::EnumDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
118M
  static bool doit(const ::clang::DeclContext &Val) {
2460
118M
    return To::classofKind(Val.getDeclKind());
2461
118M
  }
llvm::isa_impl<clang::CXXMethodDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
128M
  static bool doit(const ::clang::DeclContext &Val) {
2460
128M
    return To::classofKind(Val.getDeclKind());
2461
128M
  }
llvm::isa_impl<clang::OMPDeclareReductionDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
101M
  static bool doit(const ::clang::DeclContext &Val) {
2460
101M
    return To::classofKind(Val.getDeclKind());
2461
101M
  }
llvm::isa_impl<clang::ExportDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
7.21k
  static bool doit(const ::clang::DeclContext &Val) {
2460
7.21k
    return To::classofKind(Val.getDeclKind());
2461
7.21k
  }
llvm::isa_impl<clang::CXXConstructorDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
703k
  static bool doit(const ::clang::DeclContext &Val) {
2460
703k
    return To::classofKind(Val.getDeclKind());
2461
703k
  }
llvm::isa_impl<clang::ClassTemplateSpecializationDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
3.86M
  static bool doit(const ::clang::DeclContext &Val) {
2460
3.86M
    return To::classofKind(Val.getDeclKind());
2461
3.86M
  }
llvm::isa_impl<clang::TypeDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
418k
  static bool doit(const ::clang::DeclContext &Val) {
2460
418k
    return To::classofKind(Val.getDeclKind());
2461
418k
  }
Unexecuted instantiation: llvm::isa_impl<clang::ClassTemplateDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
llvm::isa_impl<clang::ClassTemplatePartialSpecializationDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
140M
  static bool doit(const ::clang::DeclContext &Val) {
2460
140M
    return To::classofKind(Val.getDeclKind());
2461
140M
  }
llvm::isa_impl<clang::CXXDestructorDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
652k
  static bool doit(const ::clang::DeclContext &Val) {
2460
652k
    return To::classofKind(Val.getDeclKind());
2461
652k
  }
llvm::isa_impl<clang::ObjCProtocolDecl const, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
67
  static bool doit(const ::clang::DeclContext &Val) {
2460
67
    return To::classofKind(Val.getDeclKind());
2461
67
  }
llvm::isa_impl<clang::ObjCInterfaceDecl const, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
67
  static bool doit(const ::clang::DeclContext &Val) {
2460
67
    return To::classofKind(Val.getDeclKind());
2461
67
  }
llvm::isa_impl<clang::TypedefNameDecl, clang::DeclContext, void>::doit(clang::DeclContext const&)
Line
Count
Source
2459
47
  static bool doit(const ::clang::DeclContext &Val) {
2460
47
    return To::classofKind(Val.getDeclKind());
2461
47
  }
2462
};
2463
2464
/// cast<T>(DeclContext*)
2465
template<class ToTy>
2466
struct cast_convert_val<ToTy,
2467
                        const ::clang::DeclContext,const ::clang::DeclContext> {
2468
  static const ToTy &doit(const ::clang::DeclContext &Val) {
2469
    return *::clang::cast_convert_decl_context<ToTy>::doit(&Val);
2470
  }
2471
};
2472
2473
template<class ToTy>
2474
struct cast_convert_val<ToTy, ::clang::DeclContext, ::clang::DeclContext> {
2475
  static ToTy &doit(::clang::DeclContext &Val) {
2476
    return *::clang::cast_convert_decl_context<ToTy>::doit(&Val);
2477
  }
2478
};
2479
2480
template<class ToTy>
2481
struct cast_convert_val<ToTy,
2482
                     const ::clang::DeclContext*, const ::clang::DeclContext*> {
2483
589M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
589M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
589M
  }
llvm::cast_convert_val<clang::CXXRecordDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
147M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
147M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
147M
  }
llvm::cast_convert_val<clang::RecordDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
11.9M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
11.9M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
11.9M
  }
llvm::cast_convert_val<clang::Decl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
290M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
290M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
290M
  }
llvm::cast_convert_val<clang::ObjCCategoryDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
2.88k
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
2.88k
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
2.88k
  }
llvm::cast_convert_val<clang::ObjCImplementationDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
67
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
67
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
67
  }
llvm::cast_convert_val<clang::ObjCInterfaceDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
47.7k
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
47.7k
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
47.7k
  }
llvm::cast_convert_val<clang::ObjCCategoryImplDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
71
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
71
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
71
  }
llvm::cast_convert_val<clang::NamespaceDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
19.6M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
19.6M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
19.6M
  }
llvm::cast_convert_val<clang::EnumDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
2.02M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
2.02M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
2.02M
  }
llvm::cast_convert_val<clang::CapturedDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
1.86k
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
1.86k
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
1.86k
  }
llvm::cast_convert_val<clang::FunctionDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
52.2M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
52.2M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
52.2M
  }
llvm::cast_convert_val<clang::BlockDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
113
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
113
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
113
  }
llvm::cast_convert_val<clang::ObjCMethodDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
389
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
389
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
389
  }
llvm::cast_convert_val<clang::ObjCImplDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
341
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
341
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
341
  }
llvm::cast_convert_val<clang::LinkageSpecDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
15.5M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
15.5M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
15.5M
  }
llvm::cast_convert_val<clang::ObjCContainerDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
6.53k
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
6.53k
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
6.53k
  }
llvm::cast_convert_val<clang::NamedDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
4.59M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
4.59M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
4.59M
  }
llvm::cast_convert_val<clang::ObjCProtocolDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
1.09k
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
1.09k
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
1.09k
  }
llvm::cast_convert_val<clang::TagDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
478
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
478
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
478
  }
llvm::cast_convert_val<clang::TypeDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
103
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
103
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
103
  }
llvm::cast_convert_val<clang::CXXMethodDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
21.3M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
21.3M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
21.3M
  }
llvm::cast_convert_val<clang::TranslationUnitDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
23.3M
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
23.3M
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
23.3M
  }
llvm::cast_convert_val<clang::ClassTemplateSpecializationDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
6.48k
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
6.48k
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
6.48k
  }
Unexecuted instantiation: llvm::cast_convert_val<clang::ObjCProtocolDecl const, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
llvm::cast_convert_val<clang::ObjCInterfaceDecl const, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Line
Count
Source
2483
67
  static const ToTy *doit(const ::clang::DeclContext *Val) {
2484
67
    return ::clang::cast_convert_decl_context<ToTy>::doit(Val);
2485
67
  }
Unexecuted instantiation: llvm::cast_convert_val<clang::CXXConstructorDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Unexecuted instantiation: llvm::cast_convert_val<clang::CXXDestructorDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
Unexecuted instantiation: llvm::cast_convert_val<clang::TypedefNameDecl, clang::DeclContext const*, clang::DeclContext const*>::doit(clang::DeclContext const*)
2486
};
2487
2488
template<class ToTy>
2489