Coverage Report

Created: 2020-02-25 14:32

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