Coverage Report

Created: 2021-08-24 07:12

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/AST/ODRHash.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- ODRHash.cpp - Hashing to diagnose ODR failures ----------*- 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
/// \file
10
/// This file implements the ODRHash class, which calculates a hash based
11
/// on AST nodes, which is stable across different runs.
12
///
13
//===----------------------------------------------------------------------===//
14
15
#include "clang/AST/ODRHash.h"
16
17
#include "clang/AST/DeclVisitor.h"
18
#include "clang/AST/NestedNameSpecifier.h"
19
#include "clang/AST/StmtVisitor.h"
20
#include "clang/AST/TypeVisitor.h"
21
22
using namespace clang;
23
24
374k
void ODRHash::AddStmt(const Stmt *S) {
25
374k
  assert(S && "Expecting non-null pointer.");
26
0
  S->ProcessODRHash(ID, *this);
27
374k
}
28
29
2.66M
void ODRHash::AddIdentifierInfo(const IdentifierInfo *II) {
30
2.66M
  assert(II && "Expecting non-null pointer.");
31
0
  ID.AddString(II->getName());
32
2.66M
}
33
34
4.97M
void ODRHash::AddDeclarationName(DeclarationName Name, bool TreatAsDecl) {
35
4.97M
  if (TreatAsDecl)
36
    // Matches the NamedDecl check in AddDecl
37
30.8k
    AddBoolean(true);
38
39
4.97M
  AddDeclarationNameImpl(Name);
40
41
4.97M
  if (TreatAsDecl)
42
    // Matches the ClassTemplateSpecializationDecl check in AddDecl
43
30.8k
    AddBoolean(false);
44
4.97M
}
45
46
4.97M
void ODRHash::AddDeclarationNameImpl(DeclarationName Name) {
47
  // Index all DeclarationName and use index numbers to refer to them.
48
4.97M
  auto Result = DeclNameMap.insert(std::make_pair(Name, DeclNameMap.size()));
49
4.97M
  ID.AddInteger(Result.first->second);
50
4.97M
  if (!Result.second) {
51
    // If found in map, the DeclarationName has previously been processed.
52
2.16M
    return;
53
2.16M
  }
54
55
  // First time processing each DeclarationName, also process its details.
56
2.81M
  AddBoolean(Name.isEmpty());
57
2.81M
  if (Name.isEmpty())
58
174k
    return;
59
60
2.63M
  auto Kind = Name.getNameKind();
61
2.63M
  ID.AddInteger(Kind);
62
2.63M
  switch (Kind) {
63
2.55M
  case DeclarationName::Identifier:
64
2.55M
    AddIdentifierInfo(Name.getAsIdentifierInfo());
65
2.55M
    break;
66
22
  case DeclarationName::ObjCZeroArgSelector:
67
29
  case DeclarationName::ObjCOneArgSelector:
68
36
  case DeclarationName::ObjCMultiArgSelector: {
69
36
    Selector S = Name.getObjCSelector();
70
36
    AddBoolean(S.isNull());
71
36
    AddBoolean(S.isKeywordSelector());
72
36
    AddBoolean(S.isUnarySelector());
73
36
    unsigned NumArgs = S.getNumArgs();
74
36
    ID.AddInteger(NumArgs);
75
59
    for (unsigned i = 0; i < NumArgs; 
++i23
) {
76
23
      const IdentifierInfo *II = S.getIdentifierInfoForSlot(i);
77
23
      AddBoolean(II);
78
23
      if (II) {
79
20
        AddIdentifierInfo(II);
80
20
      }
81
23
    }
82
36
    break;
83
29
  }
84
36.5k
  case DeclarationName::CXXConstructorName:
85
46.3k
  case DeclarationName::CXXDestructorName:
86
46.3k
    AddQualType(Name.getCXXNameType());
87
46.3k
    break;
88
36.1k
  case DeclarationName::CXXOperatorName:
89
36.1k
    ID.AddInteger(Name.getCXXOverloadedOperator());
90
36.1k
    break;
91
82
  case DeclarationName::CXXLiteralOperatorName:
92
82
    AddIdentifierInfo(Name.getCXXLiteralIdentifier());
93
82
    break;
94
1.05k
  case DeclarationName::CXXConversionFunctionName:
95
1.05k
    AddQualType(Name.getCXXNameType());
96
1.05k
    break;
97
77
  case DeclarationName::CXXUsingDirective:
98
77
    break;
99
937
  case DeclarationName::CXXDeductionGuideName: {
100
937
    auto *Template = Name.getCXXDeductionGuideTemplate();
101
937
    AddBoolean(Template);
102
937
    if (Template) {
103
937
      AddDecl(Template);
104
937
    }
105
937
  }
106
2.63M
  }
107
2.63M
}
108
109
224k
void ODRHash::AddNestedNameSpecifier(const NestedNameSpecifier *NNS) {
110
224k
  assert(NNS && "Expecting non-null pointer.");
111
0
  const auto *Prefix = NNS->getPrefix();
112
224k
  AddBoolean(Prefix);
113
224k
  if (Prefix) {
114
26.5k
    AddNestedNameSpecifier(Prefix);
115
26.5k
  }
116
224k
  auto Kind = NNS->getKind();
117
224k
  ID.AddInteger(Kind);
118
224k
  switch (Kind) {
119
358
  case NestedNameSpecifier::Identifier:
120
358
    AddIdentifierInfo(NNS->getAsIdentifier());
121
358
    break;
122
52.6k
  case NestedNameSpecifier::Namespace:
123
52.6k
    AddDecl(NNS->getAsNamespace());
124
52.6k
    break;
125
12
  case NestedNameSpecifier::NamespaceAlias:
126
12
    AddDecl(NNS->getAsNamespaceAlias());
127
12
    break;
128
169k
  case NestedNameSpecifier::TypeSpec:
129
169k
  case NestedNameSpecifier::TypeSpecWithTemplate:
130
169k
    AddType(NNS->getAsType());
131
169k
    break;
132
1.69k
  case NestedNameSpecifier::Global:
133
1.69k
  case NestedNameSpecifier::Super:
134
1.69k
    break;
135
224k
  }
136
224k
}
137
138
282k
void ODRHash::AddTemplateName(TemplateName Name) {
139
282k
  auto Kind = Name.getKind();
140
282k
  ID.AddInteger(Kind);
141
142
282k
  switch (Kind) {
143
282k
  case TemplateName::Template:
144
282k
    AddDecl(Name.getAsTemplateDecl());
145
282k
    break;
146
  // TODO: Support these cases.
147
0
  case TemplateName::OverloadedTemplate:
148
0
  case TemplateName::AssumedTemplate:
149
2
  case TemplateName::QualifiedTemplate:
150
17
  case TemplateName::DependentTemplate:
151
17
  case TemplateName::SubstTemplateTemplateParm:
152
17
  case TemplateName::SubstTemplateTemplateParmPack:
153
17
    break;
154
282k
  }
155
282k
}
156
157
490k
void ODRHash::AddTemplateArgument(TemplateArgument TA) {
158
490k
  const auto Kind = TA.getKind();
159
490k
  ID.AddInteger(Kind);
160
161
490k
  switch (Kind) {
162
0
    case TemplateArgument::Null:
163
0
      llvm_unreachable("Expected valid TemplateArgument");
164
450k
    case TemplateArgument::Type:
165
450k
      AddQualType(TA.getAsType());
166
450k
      break;
167
76
    case TemplateArgument::Declaration:
168
76
      AddDecl(TA.getAsDecl());
169
76
      break;
170
0
    case TemplateArgument::NullPtr:
171
4.25k
    case TemplateArgument::Integral:
172
4.25k
      break;
173
462
    case TemplateArgument::Template:
174
462
    case TemplateArgument::TemplateExpansion:
175
462
      AddTemplateName(TA.getAsTemplateOrTemplatePattern());
176
462
      break;
177
34.8k
    case TemplateArgument::Expression:
178
34.8k
      AddStmt(TA.getAsExpr());
179
34.8k
      break;
180
63
    case TemplateArgument::Pack:
181
63
      ID.AddInteger(TA.pack_size());
182
63
      for (auto SubTA : TA.pack_elements()) {
183
36
        AddTemplateArgument(SubTA);
184
36
      }
185
63
      break;
186
490k
  }
187
490k
}
188
189
19.0k
void ODRHash::AddTemplateParameterList(const TemplateParameterList *TPL) {
190
19.0k
  assert(TPL && "Expecting non-null pointer.");
191
192
0
  ID.AddInteger(TPL->size());
193
28.9k
  for (auto *ND : TPL->asArray()) {
194
28.9k
    AddSubDecl(ND);
195
28.9k
  }
196
19.0k
}
197
198
957
void ODRHash::clear() {
199
957
  DeclNameMap.clear();
200
957
  Bools.clear();
201
957
  ID.clear();
202
957
}
203
204
542k
unsigned ODRHash::CalculateHash() {
205
  // Append the bools to the end of the data segment backwards.  This allows
206
  // for the bools data to be compressed 32 times smaller compared to using
207
  // ID.AddBoolean
208
542k
  const unsigned unsigned_bits = sizeof(unsigned) * CHAR_BIT;
209
542k
  const unsigned size = Bools.size();
210
542k
  const unsigned remainder = size % unsigned_bits;
211
542k
  const unsigned loops = size / unsigned_bits;
212
542k
  auto I = Bools.rbegin();
213
542k
  unsigned value = 0;
214
7.30M
  for (unsigned i = 0; i < remainder; 
++i6.75M
) {
215
6.75M
    value <<= 1;
216
6.75M
    value |= *I;
217
6.75M
    ++I;
218
6.75M
  }
219
542k
  ID.AddInteger(value);
220
221
1.07M
  for (unsigned i = 0; i < loops; 
++i528k
) {
222
528k
    value = 0;
223
17.4M
    for (unsigned j = 0; j < unsigned_bits; 
++j16.9M
) {
224
16.9M
      value <<= 1;
225
16.9M
      value |= *I;
226
16.9M
      ++I;
227
16.9M
    }
228
528k
    ID.AddInteger(value);
229
528k
  }
230
231
542k
  assert(I == Bools.rend());
232
0
  Bools.clear();
233
542k
  return ID.ComputeHash();
234
542k
}
235
236
namespace {
237
// Process a Decl pointer.  Add* methods call back into ODRHash while Visit*
238
// methods process the relevant parts of the Decl.
239
class ODRDeclVisitor : public ConstDeclVisitor<ODRDeclVisitor> {
240
  typedef ConstDeclVisitor<ODRDeclVisitor> Inherited;
241
  llvm::FoldingSetNodeID &ID;
242
  ODRHash &Hash;
243
244
public:
245
  ODRDeclVisitor(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
246
1.12M
      : ID(ID), Hash(Hash) {}
247
248
318k
  void AddStmt(const Stmt *S) {
249
318k
    Hash.AddBoolean(S);
250
318k
    if (S) {
251
192k
      Hash.AddStmt(S);
252
192k
    }
253
318k
  }
254
255
0
  void AddIdentifierInfo(const IdentifierInfo *II) {
256
0
    Hash.AddBoolean(II);
257
0
    if (II) {
258
0
      Hash.AddIdentifierInfo(II);
259
0
    }
260
0
  }
261
262
1.01M
  void AddQualType(QualType T) {
263
1.01M
    Hash.AddQualType(T);
264
1.01M
  }
265
266
13.9k
  void AddDecl(const Decl *D) {
267
13.9k
    Hash.AddBoolean(D);
268
13.9k
    if (D) {
269
13.9k
      Hash.AddDecl(D);
270
13.9k
    }
271
13.9k
  }
272
273
2.72k
  void AddTemplateArgument(TemplateArgument TA) {
274
2.72k
    Hash.AddTemplateArgument(TA);
275
2.72k
  }
276
277
1.12M
  void Visit(const Decl *D) {
278
1.12M
    ID.AddInteger(D->getKind());
279
1.12M
    Inherited::Visit(D);
280
1.12M
  }
281
282
1.10M
  void VisitNamedDecl(const NamedDecl *D) {
283
1.10M
    Hash.AddDeclarationName(D->getDeclName());
284
1.10M
    Inherited::VisitNamedDecl(D);
285
1.10M
  }
286
287
1.04M
  void VisitValueDecl(const ValueDecl *D) {
288
1.04M
    if (!isa<FunctionDecl>(D)) {
289
992k
      AddQualType(D->getType());
290
992k
    }
291
1.04M
    Inherited::VisitValueDecl(D);
292
1.04M
  }
293
294
735k
  void VisitVarDecl(const VarDecl *D) {
295
735k
    Hash.AddBoolean(D->isStaticLocal());
296
735k
    Hash.AddBoolean(D->isConstexpr());
297
735k
    const bool HasInit = D->hasInit();
298
735k
    Hash.AddBoolean(HasInit);
299
735k
    if (HasInit) {
300
56.5k
      AddStmt(D->getInit());
301
56.5k
    }
302
735k
    Inherited::VisitVarDecl(D);
303
735k
  }
304
305
672k
  void VisitParmVarDecl(const ParmVarDecl *D) {
306
    // TODO: Handle default arguments.
307
672k
    Inherited::VisitParmVarDecl(D);
308
672k
  }
309
310
9.54k
  void VisitAccessSpecDecl(const AccessSpecDecl *D) {
311
9.54k
    ID.AddInteger(D->getAccess());
312
9.54k
    Inherited::VisitAccessSpecDecl(D);
313
9.54k
  }
314
315
2.47k
  void VisitStaticAssertDecl(const StaticAssertDecl *D) {
316
2.47k
    AddStmt(D->getAssertExpr());
317
2.47k
    AddStmt(D->getMessage());
318
319
2.47k
    Inherited::VisitStaticAssertDecl(D);
320
2.47k
  }
321
322
119k
  void VisitFieldDecl(const FieldDecl *D) {
323
119k
    const bool IsBitfield = D->isBitField();
324
119k
    Hash.AddBoolean(IsBitfield);
325
326
119k
    if (IsBitfield) {
327
1.68k
      AddStmt(D->getBitWidth());
328
1.68k
    }
329
330
119k
    Hash.AddBoolean(D->isMutable());
331
119k
    AddStmt(D->getInClassInitializer());
332
333
119k
    Inherited::VisitFieldDecl(D);
334
119k
  }
335
336
53.8k
  void VisitFunctionDecl(const FunctionDecl *D) {
337
    // Handled by the ODRHash for FunctionDecl
338
53.8k
    ID.AddInteger(D->getODRHash());
339
340
53.8k
    Inherited::VisitFunctionDecl(D);
341
53.8k
  }
342
343
53.8k
  void VisitCXXMethodDecl(const CXXMethodDecl *D) {
344
    // Handled by the ODRHash for FunctionDecl
345
346
53.8k
    Inherited::VisitCXXMethodDecl(D);
347
53.8k
  }
348
349
23.8k
  void VisitTypedefNameDecl(const TypedefNameDecl *D) {
350
23.8k
    AddQualType(D->getUnderlyingType());
351
352
23.8k
    Inherited::VisitTypedefNameDecl(D);
353
23.8k
  }
354
355
22.7k
  void VisitTypedefDecl(const TypedefDecl *D) {
356
22.7k
    Inherited::VisitTypedefDecl(D);
357
22.7k
  }
358
359
1.05k
  void VisitTypeAliasDecl(const TypeAliasDecl *D) {
360
1.05k
    Inherited::VisitTypeAliasDecl(D);
361
1.05k
  }
362
363
5.17k
  void VisitFriendDecl(const FriendDecl *D) {
364
5.17k
    TypeSourceInfo *TSI = D->getFriendType();
365
5.17k
    Hash.AddBoolean(TSI);
366
5.17k
    if (TSI) {
367
450
      AddQualType(TSI->getType());
368
4.72k
    } else {
369
4.72k
      AddDecl(D->getFriendDecl());
370
4.72k
    }
371
5.17k
  }
372
373
24.6k
  void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D) {
374
    // Only care about default arguments as part of the definition.
375
24.6k
    const bool hasDefaultArgument =
376
24.6k
        D->hasDefaultArgument() && 
!D->defaultArgumentWasInherited()2.87k
;
377
24.6k
    Hash.AddBoolean(hasDefaultArgument);
378
24.6k
    if (hasDefaultArgument) {
379
2.46k
      AddTemplateArgument(D->getDefaultArgument());
380
2.46k
    }
381
24.6k
    Hash.AddBoolean(D->isParameterPack());
382
383
24.6k
    const TypeConstraint *TC = D->getTypeConstraint();
384
24.6k
    Hash.AddBoolean(TC != nullptr);
385
24.6k
    if (TC)
386
6
      AddStmt(TC->getImmediatelyDeclaredConstraint());
387
388
24.6k
    Inherited::VisitTemplateTypeParmDecl(D);
389
24.6k
  }
390
391
3.91k
  void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D) {
392
    // Only care about default arguments as part of the definition.
393
3.91k
    const bool hasDefaultArgument =
394
3.91k
        D->hasDefaultArgument() && 
!D->defaultArgumentWasInherited()1.73k
;
395
3.91k
    Hash.AddBoolean(hasDefaultArgument);
396
3.91k
    if (hasDefaultArgument) {
397
1.70k
      AddStmt(D->getDefaultArgument());
398
1.70k
    }
399
3.91k
    Hash.AddBoolean(D->isParameterPack());
400
401
3.91k
    Inherited::VisitNonTypeTemplateParmDecl(D);
402
3.91k
  }
403
404
402
  void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D) {
405
    // Only care about default arguments as part of the definition.
406
402
    const bool hasDefaultArgument =
407
402
        D->hasDefaultArgument() && 
!D->defaultArgumentWasInherited()260
;
408
402
    Hash.AddBoolean(hasDefaultArgument);
409
402
    if (hasDefaultArgument) {
410
260
      AddTemplateArgument(D->getDefaultArgument().getArgument());
411
260
    }
412
402
    Hash.AddBoolean(D->isParameterPack());
413
414
402
    Inherited::VisitTemplateTemplateParmDecl(D);
415
402
  }
416
417
9.61k
  void VisitTemplateDecl(const TemplateDecl *D) {
418
9.61k
    Hash.AddTemplateParameterList(D->getTemplateParameters());
419
420
9.61k
    Inherited::VisitTemplateDecl(D);
421
9.61k
  }
422
423
9.21k
  void VisitRedeclarableTemplateDecl(const RedeclarableTemplateDecl *D) {
424
9.21k
    Hash.AddBoolean(D->isMemberSpecialization());
425
9.21k
    Inherited::VisitRedeclarableTemplateDecl(D);
426
9.21k
  }
427
428
9.21k
  void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
429
9.21k
    AddDecl(D->getTemplatedDecl());
430
9.21k
    ID.AddInteger(D->getTemplatedDecl()->getODRHash());
431
9.21k
    Inherited::VisitFunctionTemplateDecl(D);
432
9.21k
  }
433
434
133k
  void VisitEnumConstantDecl(const EnumConstantDecl *D) {
435
133k
    AddStmt(D->getInitExpr());
436
133k
    Inherited::VisitEnumConstantDecl(D);
437
133k
  }
438
};
439
} // namespace
440
441
// Only allow a small portion of Decl's to be processed.  Remove this once
442
// all Decl's can be handled.
443
775k
bool ODRHash::isDeclToBeProcessed(const Decl *D, const DeclContext *Parent) {
444
775k
  if (D->isImplicit()) 
return false101k
;
445
673k
  if (D->getDeclContext() != Parent) 
return false1.43k
;
446
447
672k
  switch (D->getKind()) {
448
252k
    default:
449
252k
      return false;
450
9.54k
    case Decl::AccessSpec:
451
23.2k
    case Decl::CXXConstructor:
452
26.2k
    case Decl::CXXDestructor:
453
63.3k
    case Decl::CXXMethod:
454
197k
    case Decl::EnumConstant: // Only found in EnumDecl's.
455
316k
    case Decl::Field:
456
321k
    case Decl::Friend:
457
330k
    case Decl::FunctionTemplate:
458
333k
    case Decl::StaticAssert:
459
334k
    case Decl::TypeAlias:
460
357k
    case Decl::Typedef:
461
420k
    case Decl::Var:
462
420k
      return true;
463
672k
  }
464
672k
}
465
466
1.12M
void ODRHash::AddSubDecl(const Decl *D) {
467
1.12M
  assert(D && "Expecting non-null pointer.");
468
469
0
  ODRDeclVisitor(ID, *this).Visit(D);
470
1.12M
}
471
472
108k
void ODRHash::AddCXXRecordDecl(const CXXRecordDecl *Record) {
473
108k
  assert(Record && Record->hasDefinition() &&
474
108k
         "Expected non-null record to be a definition.");
475
476
0
  const DeclContext *DC = Record;
477
370k
  while (DC) {
478
303k
    if (isa<ClassTemplateSpecializationDecl>(DC)) {
479
42.1k
      return;
480
42.1k
    }
481
261k
    DC = DC->getParent();
482
261k
  }
483
484
66.8k
  AddDecl(Record);
485
486
  // Filter out sub-Decls which will not be processed in order to get an
487
  // accurate count of Decl's.
488
66.8k
  llvm::SmallVector<const Decl *, 16> Decls;
489
296k
  for (Decl *SubDecl : Record->decls()) {
490
296k
    if (isDeclToBeProcessed(SubDecl, Record)) {
491
217k
      Decls.push_back(SubDecl);
492
217k
      if (auto *Function = dyn_cast<FunctionDecl>(SubDecl)) {
493
        // Compute/Preload ODRHash into FunctionDecl.
494
53.6k
        Function->getODRHash();
495
53.6k
      }
496
217k
    }
497
296k
  }
498
499
66.8k
  ID.AddInteger(Decls.size());
500
217k
  for (auto SubDecl : Decls) {
501
217k
    AddSubDecl(SubDecl);
502
217k
  }
503
504
66.8k
  const ClassTemplateDecl *TD = Record->getDescribedClassTemplate();
505
66.8k
  AddBoolean(TD);
506
66.8k
  if (TD) {
507
9.38k
    AddTemplateParameterList(TD->getTemplateParameters());
508
9.38k
  }
509
510
66.8k
  ID.AddInteger(Record->getNumBases());
511
66.8k
  auto Bases = Record->bases();
512
66.8k
  for (auto Base : Bases) {
513
4.76k
    AddQualType(Base.getType());
514
4.76k
    ID.AddInteger(Base.isVirtual());
515
4.76k
    ID.AddInteger(Base.getAccessSpecifierAsWritten());
516
4.76k
  }
517
66.8k
}
518
519
void ODRHash::AddFunctionDecl(const FunctionDecl *Function,
520
413k
                              bool SkipBody) {
521
413k
  assert(Function && "Expecting non-null pointer.");
522
523
  // Skip functions that are specializations or in specialization context.
524
0
  const DeclContext *DC = Function;
525
1.64M
  while (DC) {
526
1.28M
    if (isa<ClassTemplateSpecializationDecl>(DC)) 
return41.5k
;
527
1.23M
    if (auto *F = dyn_cast<FunctionDecl>(DC)) {
528
416k
      if (F->isFunctionTemplateSpecialization()) {
529
10.2k
        if (!isa<CXXMethodDecl>(DC)) 
return6.07k
;
530
4.18k
        if (DC->getLexicalParent()->isFileContext()) 
return31
;
531
        // Inline method specializations are the only supported
532
        // specialization for now.
533
4.18k
      }
534
416k
    }
535
1.23M
    DC = DC->getParent();
536
1.23M
  }
537
538
366k
  ID.AddInteger(Function->getDeclKind());
539
540
366k
  const auto *SpecializationArgs = Function->getTemplateSpecializationArgs();
541
366k
  AddBoolean(SpecializationArgs);
542
366k
  if (SpecializationArgs) {
543
2.29k
    ID.AddInteger(SpecializationArgs->size());
544
2.40k
    for (const TemplateArgument &TA : SpecializationArgs->asArray()) {
545
2.40k
      AddTemplateArgument(TA);
546
2.40k
    }
547
2.29k
  }
548
549
366k
  if (const auto *Method = dyn_cast<CXXMethodDecl>(Function)) {
550
89.6k
    AddBoolean(Method->isConst());
551
89.6k
    AddBoolean(Method->isVolatile());
552
89.6k
  }
553
554
366k
  ID.AddInteger(Function->getStorageClass());
555
366k
  AddBoolean(Function->isInlineSpecified());
556
366k
  AddBoolean(Function->isVirtualAsWritten());
557
366k
  AddBoolean(Function->isPure());
558
366k
  AddBoolean(Function->isDeletedAsWritten());
559
366k
  AddBoolean(Function->isExplicitlyDefaulted());
560
561
366k
  AddDecl(Function);
562
563
366k
  AddQualType(Function->getReturnType());
564
565
366k
  ID.AddInteger(Function->param_size());
566
366k
  for (auto Param : Function->parameters())
567
672k
    AddSubDecl(Param);
568
569
366k
  if (SkipBody) {
570
14
    AddBoolean(false);
571
14
    return;
572
14
  }
573
574
366k
  const bool HasBody = Function->isThisDeclarationADefinition() &&
575
366k
                       
!Function->isDefaulted()153k
&&
!Function->isDeleted()143k
&&
576
366k
                       
!Function->isLateTemplateParsed()143k
;
577
366k
  AddBoolean(HasBody);
578
366k
  if (!HasBody) {
579
223k
    return;
580
223k
  }
581
582
143k
  auto *Body = Function->getBody();
583
143k
  AddBoolean(Body);
584
143k
  if (Body)
585
143k
    AddStmt(Body);
586
587
  // Filter out sub-Decls which will not be processed in order to get an
588
  // accurate count of Decl's.
589
143k
  llvm::SmallVector<const Decl *, 16> Decls;
590
344k
  for (Decl *SubDecl : Function->decls()) {
591
344k
    if (isDeclToBeProcessed(SubDecl, Function)) {
592
68.4k
      Decls.push_back(SubDecl);
593
68.4k
    }
594
344k
  }
595
596
143k
  ID.AddInteger(Decls.size());
597
143k
  for (auto SubDecl : Decls) {
598
68.4k
    AddSubDecl(SubDecl);
599
68.4k
  }
600
143k
}
601
602
18.8k
void ODRHash::AddEnumDecl(const EnumDecl *Enum) {
603
18.8k
  assert(Enum);
604
0
  AddDeclarationName(Enum->getDeclName());
605
606
18.8k
  AddBoolean(Enum->isScoped());
607
18.8k
  if (Enum->isScoped())
608
218
    AddBoolean(Enum->isScopedUsingClassTag());
609
610
18.8k
  if (Enum->getIntegerTypeSourceInfo())
611
5.13k
    AddQualType(Enum->getIntegerType());
612
613
  // Filter out sub-Decls which will not be processed in order to get an
614
  // accurate count of Decl's.
615
18.8k
  llvm::SmallVector<const Decl *, 16> Decls;
616
133k
  for (Decl *SubDecl : Enum->decls()) {
617
133k
    if (isDeclToBeProcessed(SubDecl, Enum)) {
618
133k
      assert(isa<EnumConstantDecl>(SubDecl) && "Unexpected Decl");
619
0
      Decls.push_back(SubDecl);
620
133k
    }
621
133k
  }
622
623
18.8k
  ID.AddInteger(Decls.size());
624
133k
  for (auto SubDecl : Decls) {
625
133k
    AddSubDecl(SubDecl);
626
133k
  }
627
628
18.8k
}
629
630
3.67M
void ODRHash::AddDecl(const Decl *D) {
631
3.67M
  assert(D && "Expecting non-null pointer.");
632
0
  D = D->getCanonicalDecl();
633
634
3.67M
  const NamedDecl *ND = dyn_cast<NamedDecl>(D);
635
3.67M
  AddBoolean(ND);
636
3.67M
  if (!ND) {
637
1.52k
    ID.AddInteger(D->getKind());
638
1.52k
    return;
639
1.52k
  }
640
641
3.66M
  AddDeclarationName(ND->getDeclName());
642
643
3.66M
  const auto *Specialization =
644
3.66M
            dyn_cast<ClassTemplateSpecializationDecl>(D);
645
3.66M
  AddBoolean(Specialization);
646
3.66M
  if (Specialization) {
647
7.84k
    const TemplateArgumentList &List = Specialization->getTemplateArgs();
648
7.84k
    ID.AddInteger(List.size());
649
7.84k
    for (const TemplateArgument &TA : List.asArray())
650
14.4k
      AddTemplateArgument(TA);
651
7.84k
  }
652
3.66M
}
653
654
namespace {
655
// Process a Type pointer.  Add* methods call back into ODRHash while Visit*
656
// methods process the relevant parts of the Type.
657
class ODRTypeVisitor : public TypeVisitor<ODRTypeVisitor> {
658
  typedef TypeVisitor<ODRTypeVisitor> Inherited;
659
  llvm::FoldingSetNodeID &ID;
660
  ODRHash &Hash;
661
662
public:
663
  ODRTypeVisitor(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
664
4.68M
      : ID(ID), Hash(Hash) {}
665
666
3.98k
  void AddStmt(Stmt *S) {
667
3.98k
    Hash.AddBoolean(S);
668
3.98k
    if (S) {
669
3.97k
      Hash.AddStmt(S);
670
3.97k
    }
671
3.98k
  }
672
673
2.04M
  void AddDecl(Decl *D) {
674
2.04M
    Hash.AddBoolean(D);
675
2.04M
    if (D) {
676
2.04M
      Hash.AddDecl(D);
677
2.04M
    }
678
2.04M
  }
679
680
1.15M
  void AddQualType(QualType T) {
681
1.15M
    Hash.AddQualType(T);
682
1.15M
  }
683
684
1.25M
  void AddType(const Type *T) {
685
1.25M
    Hash.AddBoolean(T);
686
1.25M
    if (T) {
687
1.25M
      Hash.AddType(T);
688
1.25M
    }
689
1.25M
  }
690
691
215k
  void AddNestedNameSpecifier(const NestedNameSpecifier *NNS) {
692
215k
    Hash.AddBoolean(NNS);
693
215k
    if (NNS) {
694
126k
      Hash.AddNestedNameSpecifier(NNS);
695
126k
    }
696
215k
  }
697
698
117k
  void AddIdentifierInfo(const IdentifierInfo *II) {
699
117k
    Hash.AddBoolean(II);
700
117k
    if (II) {
701
117k
      Hash.AddIdentifierInfo(II);
702
117k
    }
703
117k
  }
704
705
1.27M
  void VisitQualifiers(Qualifiers Quals) {
706
1.27M
    ID.AddInteger(Quals.getAsOpaqueValue());
707
1.27M
  }
708
709
  // Return the RecordType if the typedef only strips away a keyword.
710
  // Otherwise, return the original type.
711
4.68M
  static const Type *RemoveTypedef(const Type *T) {
712
4.68M
    const auto *TypedefT = dyn_cast<TypedefType>(T);
713
4.68M
    if (!TypedefT) {
714
3.41M
      return T;
715
3.41M
    }
716
717
1.27M
    const TypedefNameDecl *D = TypedefT->getDecl();
718
1.27M
    QualType UnderlyingType = D->getUnderlyingType();
719
720
1.27M
    if (UnderlyingType.hasLocalQualifiers()) {
721
115
      return T;
722
115
    }
723
724
1.27M
    const auto *ElaboratedT = dyn_cast<ElaboratedType>(UnderlyingType);
725
1.27M
    if (!ElaboratedT) {
726
1.19M
      return T;
727
1.19M
    }
728
729
77.0k
    if (ElaboratedT->getQualifier() != nullptr) {
730
9.08k
      return T;
731
9.08k
    }
732
733
67.9k
    QualType NamedType = ElaboratedT->getNamedType();
734
67.9k
    if (NamedType.hasLocalQualifiers()) {
735
0
      return T;
736
0
    }
737
738
67.9k
    const auto *RecordT = dyn_cast<RecordType>(NamedType);
739
67.9k
    if (!RecordT) {
740
6.12k
      return T;
741
6.12k
    }
742
743
61.8k
    const IdentifierInfo *TypedefII = TypedefT->getDecl()->getIdentifier();
744
61.8k
    const IdentifierInfo *RecordII = RecordT->getDecl()->getIdentifier();
745
61.8k
    if (!TypedefII || !RecordII ||
746
61.8k
        
TypedefII->getName() != RecordII->getName()31.0k
) {
747
46.7k
      return T;
748
46.7k
    }
749
750
15.0k
    return RecordT;
751
61.8k
  }
752
753
4.68M
  void Visit(const Type *T) {
754
4.68M
    T = RemoveTypedef(T);
755
4.68M
    ID.AddInteger(T->getTypeClass());
756
4.68M
    Inherited::Visit(T);
757
4.68M
  }
758
759
4.26M
  void VisitType(const Type *T) {}
760
761
3.95k
  void VisitAdjustedType(const AdjustedType *T) {
762
3.95k
    QualType Original = T->getOriginalType();
763
3.95k
    QualType Adjusted = T->getAdjustedType();
764
765
    // The original type and pointee type can be the same, as in the case of
766
    // function pointers decaying to themselves.  Set a bool and only process
767
    // the type once, to prevent doubling the work.
768
3.95k
    SplitQualType split = Adjusted.split();
769
3.95k
    if (auto Pointer = dyn_cast<PointerType>(split.Ty)) {
770
3.72k
      if (Pointer->getPointeeType() == Original) {
771
215
        Hash.AddBoolean(true);
772
215
        ID.AddInteger(split.Quals.getAsOpaqueValue());
773
215
        AddQualType(Original);
774
215
        VisitType(T);
775
215
        return;
776
215
      }
777
3.72k
    }
778
779
    // The original type and pointee type are different, such as in the case
780
    // of a array decaying to an element pointer.  Set a bool to false and
781
    // process both types.
782
3.74k
    Hash.AddBoolean(false);
783
3.74k
    AddQualType(Original);
784
3.74k
    AddQualType(Adjusted);
785
786
3.74k
    VisitType(T);
787
3.74k
  }
788
789
3.95k
  void VisitDecayedType(const DecayedType *T) {
790
    // getDecayedType and getPointeeType are derived from getAdjustedType
791
    // and don't need to be separately processed.
792
3.95k
    VisitAdjustedType(T);
793
3.95k
  }
794
795
17.6k
  void VisitArrayType(const ArrayType *T) {
796
17.6k
    AddQualType(T->getElementType());
797
17.6k
    ID.AddInteger(T->getSizeModifier());
798
17.6k
    VisitQualifiers(T->getIndexTypeQualifiers());
799
17.6k
    VisitType(T);
800
17.6k
  }
801
13.6k
  void VisitConstantArrayType(const ConstantArrayType *T) {
802
13.6k
    T->getSize().Profile(ID);
803
13.6k
    VisitArrayType(T);
804
13.6k
  }
805
806
823
  void VisitDependentSizedArrayType(const DependentSizedArrayType *T) {
807
823
    AddStmt(T->getSizeExpr());
808
823
    VisitArrayType(T);
809
823
  }
810
811
1.88k
  void VisitIncompleteArrayType(const IncompleteArrayType *T) {
812
1.88k
    VisitArrayType(T);
813
1.88k
  }
814
815
1.35k
  void VisitVariableArrayType(const VariableArrayType *T) {
816
1.35k
    AddStmt(T->getSizeExpr());
817
1.35k
    VisitArrayType(T);
818
1.35k
  }
819
820
45.2k
  void VisitAttributedType(const AttributedType *T) {
821
45.2k
    ID.AddInteger(T->getAttrKind());
822
45.2k
    AddQualType(T->getModifiedType());
823
45.2k
    AddQualType(T->getEquivalentType());
824
825
45.2k
    VisitType(T);
826
45.2k
  }
827
828
1.54k
  void VisitBlockPointerType(const BlockPointerType *T) {
829
1.54k
    AddQualType(T->getPointeeType());
830
1.54k
    VisitType(T);
831
1.54k
  }
832
833
1.19M
  void VisitBuiltinType(const BuiltinType *T) {
834
1.19M
    ID.AddInteger(T->getKind());
835
1.19M
    VisitType(T);
836
1.19M
  }
837
838
4.60k
  void VisitComplexType(const ComplexType *T) {
839
4.60k
    AddQualType(T->getElementType());
840
4.60k
    VisitType(T);
841
4.60k
  }
842
843
1.74k
  void VisitDecltypeType(const DecltypeType *T) {
844
1.74k
    AddStmt(T->getUnderlyingExpr());
845
1.74k
    AddQualType(T->getUnderlyingType());
846
1.74k
    VisitType(T);
847
1.74k
  }
848
849
0
  void VisitDependentDecltypeType(const DependentDecltypeType *T) {
850
0
    VisitDecltypeType(T);
851
0
  }
852
853
801
  void VisitDeducedType(const DeducedType *T) {
854
801
    AddQualType(T->getDeducedType());
855
801
    VisitType(T);
856
801
  }
857
858
793
  void VisitAutoType(const AutoType *T) {
859
793
    ID.AddInteger((unsigned)T->getKeyword());
860
793
    ID.AddInteger(T->isConstrained());
861
793
    if (T->isConstrained()) {
862
0
      AddDecl(T->getTypeConstraintConcept());
863
0
      ID.AddInteger(T->getNumArgs());
864
0
      for (const auto &TA : T->getTypeConstraintArguments())
865
0
        Hash.AddTemplateArgument(TA);
866
0
    }
867
793
    VisitDeducedType(T);
868
793
  }
869
870
  void VisitDeducedTemplateSpecializationType(
871
8
      const DeducedTemplateSpecializationType *T) {
872
8
    Hash.AddTemplateName(T->getTemplateName());
873
8
    VisitDeducedType(T);
874
8
  }
875
876
11
  void VisitDependentAddressSpaceType(const DependentAddressSpaceType *T) {
877
11
    AddQualType(T->getPointeeType());
878
11
    AddStmt(T->getAddrSpaceExpr());
879
11
    VisitType(T);
880
11
  }
881
882
6
  void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T) {
883
6
    AddQualType(T->getElementType());
884
6
    AddStmt(T->getSizeExpr());
885
6
    VisitType(T);
886
6
  }
887
888
23.1k
  void VisitFunctionType(const FunctionType *T) {
889
23.1k
    AddQualType(T->getReturnType());
890
23.1k
    T->getExtInfo().Profile(ID);
891
23.1k
    Hash.AddBoolean(T->isConst());
892
23.1k
    Hash.AddBoolean(T->isVolatile());
893
23.1k
    Hash.AddBoolean(T->isRestrict());
894
23.1k
    VisitType(T);
895
23.1k
  }
896
897
3
  void VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
898
3
    VisitFunctionType(T);
899
3
  }
900
901
23.1k
  void VisitFunctionProtoType(const FunctionProtoType *T) {
902
23.1k
    ID.AddInteger(T->getNumParams());
903
23.1k
    for (auto ParamType : T->getParamTypes())
904
59.9k
      AddQualType(ParamType);
905
906
23.1k
    VisitFunctionType(T);
907
23.1k
  }
908
909
39.2k
  void VisitInjectedClassNameType(const InjectedClassNameType *T) {
910
39.2k
    AddDecl(T->getDecl());
911
39.2k
    VisitType(T);
912
39.2k
  }
913
914
639
  void VisitMemberPointerType(const MemberPointerType *T) {
915
639
    AddQualType(T->getPointeeType());
916
639
    AddType(T->getClass());
917
639
    VisitType(T);
918
639
  }
919
920
7.75k
  void VisitObjCObjectPointerType(const ObjCObjectPointerType *T) {
921
7.75k
    AddQualType(T->getPointeeType());
922
7.75k
    VisitType(T);
923
7.75k
  }
924
925
7.77k
  void VisitObjCObjectType(const ObjCObjectType *T) {
926
7.77k
    AddDecl(T->getInterface());
927
928
7.77k
    auto TypeArgs = T->getTypeArgsAsWritten();
929
7.77k
    ID.AddInteger(TypeArgs.size());
930
7.77k
    for (auto Arg : TypeArgs) {
931
48
      AddQualType(Arg);
932
48
    }
933
934
7.77k
    auto Protocols = T->getProtocols();
935
7.77k
    ID.AddInteger(Protocols.size());
936
7.77k
    for (auto Protocol : Protocols) {
937
3.43k
      AddDecl(Protocol);
938
3.43k
    }
939
940
7.77k
    Hash.AddBoolean(T->isKindOfType());
941
942
7.77k
    VisitType(T);
943
7.77k
  }
944
945
1.58k
  void VisitObjCInterfaceType(const ObjCInterfaceType *T) {
946
    // This type is handled by the parent type ObjCObjectType.
947
1.58k
    VisitObjCObjectType(T);
948
1.58k
  }
949
950
8
  void VisitObjCTypeParamType(const ObjCTypeParamType *T) {
951
8
    AddDecl(T->getDecl());
952
8
    auto Protocols = T->getProtocols();
953
8
    ID.AddInteger(Protocols.size());
954
8
    for (auto Protocol : Protocols) {
955
7
      AddDecl(Protocol);
956
7
    }
957
958
8
    VisitType(T);
959
8
  }
960
961
5.10k
  void VisitPackExpansionType(const PackExpansionType *T) {
962
5.10k
    AddQualType(T->getPattern());
963
5.10k
    VisitType(T);
964
5.10k
  }
965
966
22.5k
  void VisitParenType(const ParenType *T) {
967
22.5k
    AddQualType(T->getInnerType());
968
22.5k
    VisitType(T);
969
22.5k
  }
970
971
12
  void VisitPipeType(const PipeType *T) {
972
12
    AddQualType(T->getElementType());
973
12
    Hash.AddBoolean(T->isReadOnly());
974
12
    VisitType(T);
975
12
  }
976
977
328k
  void VisitPointerType(const PointerType *T) {
978
328k
    AddQualType(T->getPointeeType());
979
328k
    VisitType(T);
980
328k
  }
981
982
93.5k
  void VisitReferenceType(const ReferenceType *T) {
983
93.5k
    AddQualType(T->getPointeeTypeAsWritten());
984
93.5k
    VisitType(T);
985
93.5k
  }
986
987
82.0k
  void VisitLValueReferenceType(const LValueReferenceType *T) {
988
82.0k
    VisitReferenceType(T);
989
82.0k
  }
990
991
11.5k
  void VisitRValueReferenceType(const RValueReferenceType *T) {
992
11.5k
    VisitReferenceType(T);
993
11.5k
  }
994
995
  void
996
0
  VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T) {
997
0
    AddType(T->getReplacedParameter());
998
0
    Hash.AddTemplateArgument(T->getArgumentPack());
999
0
    VisitType(T);
1000
0
  }
1001
1002
2.46k
  void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) {
1003
2.46k
    AddType(T->getReplacedParameter());
1004
2.46k
    AddQualType(T->getReplacementType());
1005
2.46k
    VisitType(T);
1006
2.46k
  }
1007
1008
328k
  void VisitTagType(const TagType *T) {
1009
328k
    AddDecl(T->getDecl());
1010
328k
    VisitType(T);
1011
328k
  }
1012
1013
236k
  void VisitRecordType(const RecordType *T) { VisitTagType(T); }
1014
91.4k
  void VisitEnumType(const EnumType *T) { VisitTagType(T); }
1015
1016
281k
  void VisitTemplateSpecializationType(const TemplateSpecializationType *T) {
1017
281k
    ID.AddInteger(T->getNumArgs());
1018
470k
    for (const auto &TA : T->template_arguments()) {
1019
470k
      Hash.AddTemplateArgument(TA);
1020
470k
    }
1021
281k
    Hash.AddTemplateName(T->getTemplateName());
1022
281k
    VisitType(T);
1023
281k
  }
1024
1025
414k
  void VisitTemplateTypeParmType(const TemplateTypeParmType *T) {
1026
414k
    ID.AddInteger(T->getDepth());
1027
414k
    ID.AddInteger(T->getIndex());
1028
414k
    Hash.AddBoolean(T->isParameterPack());
1029
414k
    AddDecl(T->getDecl());
1030
414k
  }
1031
1032
1.25M
  void VisitTypedefType(const TypedefType *T) {
1033
1.25M
    AddDecl(T->getDecl());
1034
1.25M
    QualType UnderlyingType = T->getDecl()->getUnderlyingType();
1035
1.25M
    VisitQualifiers(UnderlyingType.getQualifiers());
1036
1.52M
    while (true) {
1037
1.52M
      if (const TypedefType *Underlying =
1038
1.52M
              dyn_cast<TypedefType>(UnderlyingType.getTypePtr())) {
1039
200k
        UnderlyingType = Underlying->getDecl()->getUnderlyingType();
1040
200k
        continue;
1041
200k
      }
1042
1.32M
      if (const ElaboratedType *Underlying =
1043
1.32M
              dyn_cast<ElaboratedType>(UnderlyingType.getTypePtr())) {
1044
68.7k
        UnderlyingType = Underlying->getNamedType();
1045
68.7k
        continue;
1046
68.7k
      }
1047
1048
1.25M
      break;
1049
1.32M
    }
1050
1.25M
    AddType(UnderlyingType.getTypePtr());
1051
1.25M
    VisitType(T);
1052
1.25M
  }
1053
1054
39
  void VisitTypeOfExprType(const TypeOfExprType *T) {
1055
39
    AddStmt(T->getUnderlyingExpr());
1056
39
    Hash.AddBoolean(T->isSugared());
1057
39
    if (T->isSugared())
1058
38
      AddQualType(T->desugar());
1059
1060
39
    VisitType(T);
1061
39
  }
1062
20
  void VisitTypeOfType(const TypeOfType *T) {
1063
20
    AddQualType(T->getUnderlyingType());
1064
20
    VisitType(T);
1065
20
  }
1066
1067
215k
  void VisitTypeWithKeyword(const TypeWithKeyword *T) {
1068
215k
    ID.AddInteger(T->getKeyword());
1069
215k
    VisitType(T);
1070
215k
  };
1071
1072
117k
  void VisitDependentNameType(const DependentNameType *T) {
1073
117k
    AddNestedNameSpecifier(T->getQualifier());
1074
117k
    AddIdentifierInfo(T->getIdentifier());
1075
117k
    VisitTypeWithKeyword(T);
1076
117k
  }
1077
1078
  void VisitDependentTemplateSpecializationType(
1079
122
      const DependentTemplateSpecializationType *T) {
1080
122
    AddIdentifierInfo(T->getIdentifier());
1081
122
    AddNestedNameSpecifier(T->getQualifier());
1082
122
    ID.AddInteger(T->getNumArgs());
1083
122
    for (const auto &TA : T->template_arguments()) {
1084
122
      Hash.AddTemplateArgument(TA);
1085
122
    }
1086
122
    VisitTypeWithKeyword(T);
1087
122
  }
1088
1089
98.0k
  void VisitElaboratedType(const ElaboratedType *T) {
1090
98.0k
    AddNestedNameSpecifier(T->getQualifier());
1091
98.0k
    AddQualType(T->getNamedType());
1092
98.0k
    VisitTypeWithKeyword(T);
1093
98.0k
  }
1094
1095
428
  void VisitUnaryTransformType(const UnaryTransformType *T) {
1096
428
    AddQualType(T->getUnderlyingType());
1097
428
    AddQualType(T->getBaseType());
1098
428
    VisitType(T);
1099
428
  }
1100
1101
139
  void VisitUnresolvedUsingType(const UnresolvedUsingType *T) {
1102
139
    AddDecl(T->getDecl());
1103
139
    VisitType(T);
1104
139
  }
1105
1106
388k
  void VisitVectorType(const VectorType *T) {
1107
388k
    AddQualType(T->getElementType());
1108
388k
    ID.AddInteger(T->getNumElements());
1109
388k
    ID.AddInteger(T->getVectorKind());
1110
388k
    VisitType(T);
1111
388k
  }
1112
1113
106k
  void VisitExtVectorType(const ExtVectorType * T) {
1114
106k
    VisitVectorType(T);
1115
106k
  }
1116
};
1117
} // namespace
1118
1119
4.68M
void ODRHash::AddType(const Type *T) {
1120
4.68M
  assert(T && "Expecting non-null pointer.");
1121
0
  ODRTypeVisitor(ID, *this).Visit(T);
1122
4.68M
}
1123
1124
3.25M
void ODRHash::AddQualType(QualType T) {
1125
3.25M
  AddBoolean(T.isNull());
1126
3.25M
  if (T.isNull())
1127
1.16k
    return;
1128
3.25M
  SplitQualType split = T.split();
1129
3.25M
  ID.AddInteger(split.Quals.getAsOpaqueValue());
1130
3.25M
  AddType(split.Ty);
1131
3.25M
}
1132
1133
23.6M
void ODRHash::AddBoolean(bool Value) {
1134
23.6M
  Bools.push_back(Value);
1135
23.6M
}