Coverage Report

Created: 2020-10-24 06:27

/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
423k
void ODRHash::AddStmt(const Stmt *S) {
25
423k
  assert(S && "Expecting non-null pointer.");
26
423k
  S->ProcessODRHash(ID, *this);
27
423k
}
28
29
2.91M
void ODRHash::AddIdentifierInfo(const IdentifierInfo *II) {
30
2.91M
  assert(II && "Expecting non-null pointer.");
31
2.91M
  ID.AddString(II->getName());
32
2.91M
}
33
34
5.30M
void ODRHash::AddDeclarationName(DeclarationName Name, bool TreatAsDecl) {
35
5.30M
  if (TreatAsDecl)
36
    // Matches the NamedDecl check in AddDecl
37
31.0k
    AddBoolean(true);
38
39
5.30M
  AddDeclarationNameImpl(Name);
40
41
5.30M
  if (TreatAsDecl)
42
    // Matches the ClassTemplateSpecializationDecl check in AddDecl
43
31.0k
    AddBoolean(false);
44
5.30M
}
45
46
5.30M
void ODRHash::AddDeclarationNameImpl(DeclarationName Name) {
47
  // Index all DeclarationName and use index numbers to refer to them.
48
5.30M
  auto Result = DeclNameMap.insert(std::make_pair(Name, DeclNameMap.size()));
49
5.30M
  ID.AddInteger(Result.first->second);
50
5.30M
  if (!Result.second) {
51
    // If found in map, the DeclarationName has previously been processed.
52
2.25M
    return;
53
2.25M
  }
54
55
  // First time processing each DeclarationName, also process its details.
56
3.05M
  AddBoolean(Name.isEmpty());
57
3.05M
  if (Name.isEmpty())
58
188k
    return;
59
60
2.86M
  auto Kind = Name.getNameKind();
61
2.86M
  ID.AddInteger(Kind);
62
2.86M
  switch (Kind) {
63
2.77M
  case DeclarationName::Identifier:
64
2.77M
    AddIdentifierInfo(Name.getAsIdentifierInfo());
65
2.77M
    break;
66
38
  case DeclarationName::ObjCZeroArgSelector:
67
38
  case DeclarationName::ObjCOneArgSelector:
68
38
  case DeclarationName::ObjCMultiArgSelector: {
69
38
    Selector S = Name.getObjCSelector();
70
38
    AddBoolean(S.isNull());
71
38
    AddBoolean(S.isKeywordSelector());
72
38
    AddBoolean(S.isUnarySelector());
73
38
    unsigned NumArgs = S.getNumArgs();
74
38
    ID.AddInteger(NumArgs);
75
61
    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
38
    break;
83
38
  }
84
45.4k
  case DeclarationName::CXXConstructorName:
85
45.4k
  case DeclarationName::CXXDestructorName:
86
45.4k
    AddQualType(Name.getCXXNameType());
87
45.4k
    break;
88
36.6k
  case DeclarationName::CXXOperatorName:
89
36.6k
    ID.AddInteger(Name.getCXXOverloadedOperator());
90
36.6k
    break;
91
82
  case DeclarationName::CXXLiteralOperatorName:
92
82
    AddIdentifierInfo(Name.getCXXLiteralIdentifier());
93
82
    break;
94
1.04k
  case DeclarationName::CXXConversionFunctionName:
95
1.04k
    AddQualType(Name.getCXXNameType());
96
1.04k
    break;
97
110
  case DeclarationName::CXXUsingDirective:
98
110
    break;
99
887
  case DeclarationName::CXXDeductionGuideName: {
100
887
    auto *Template = Name.getCXXDeductionGuideTemplate();
101
887
    AddBoolean(Template);
102
887
    if (Template) {
103
887
      AddDecl(Template);
104
887
    }
105
887
  }
106
2.86M
  }
107
2.86M
}
108
109
242k
void ODRHash::AddNestedNameSpecifier(const NestedNameSpecifier *NNS) {
110
242k
  assert(NNS && "Expecting non-null pointer.");
111
242k
  const auto *Prefix = NNS->getPrefix();
112
242k
  AddBoolean(Prefix);
113
242k
  if (Prefix) {
114
24.6k
    AddNestedNameSpecifier(Prefix);
115
24.6k
  }
116
242k
  auto Kind = NNS->getKind();
117
242k
  ID.AddInteger(Kind);
118
242k
  switch (Kind) {
119
358
  case NestedNameSpecifier::Identifier:
120
358
    AddIdentifierInfo(NNS->getAsIdentifier());
121
358
    break;
122
48.6k
  case NestedNameSpecifier::Namespace:
123
48.6k
    AddDecl(NNS->getAsNamespace());
124
48.6k
    break;
125
12
  case NestedNameSpecifier::NamespaceAlias:
126
12
    AddDecl(NNS->getAsNamespaceAlias());
127
12
    break;
128
191k
  case NestedNameSpecifier::TypeSpec:
129
191k
  case NestedNameSpecifier::TypeSpecWithTemplate:
130
191k
    AddType(NNS->getAsType());
131
191k
    break;
132
1.92k
  case NestedNameSpecifier::Global:
133
1.92k
  case NestedNameSpecifier::Super:
134
1.92k
    break;
135
242k
  }
136
242k
}
137
138
278k
void ODRHash::AddTemplateName(TemplateName Name) {
139
278k
  auto Kind = Name.getKind();
140
278k
  ID.AddInteger(Kind);
141
142
278k
  switch (Kind) {
143
277k
  case TemplateName::Template:
144
277k
    AddDecl(Name.getAsTemplateDecl());
145
277k
    break;
146
  // TODO: Support these cases.
147
171
  case TemplateName::OverloadedTemplate:
148
171
  case TemplateName::AssumedTemplate:
149
171
  case TemplateName::QualifiedTemplate:
150
171
  case TemplateName::DependentTemplate:
151
171
  case TemplateName::SubstTemplateTemplateParm:
152
171
  case TemplateName::SubstTemplateTemplateParmPack:
153
171
    break;
154
278k
  }
155
278k
}
156
157
485k
void ODRHash::AddTemplateArgument(TemplateArgument TA) {
158
485k
  const auto Kind = TA.getKind();
159
485k
  ID.AddInteger(Kind);
160
161
485k
  switch (Kind) {
162
0
    case TemplateArgument::Null:
163
0
      llvm_unreachable("Expected valid TemplateArgument");
164
445k
    case TemplateArgument::Type:
165
445k
      AddQualType(TA.getAsType());
166
445k
      break;
167
76
    case TemplateArgument::Declaration:
168
76
      AddDecl(TA.getAsDecl());
169
76
      break;
170
5.13k
    case TemplateArgument::NullPtr:
171
5.13k
    case TemplateArgument::Integral:
172
5.13k
      break;
173
198
    case TemplateArgument::Template:
174
198
    case TemplateArgument::TemplateExpansion:
175
198
      AddTemplateName(TA.getAsTemplateOrTemplatePattern());
176
198
      break;
177
34.8k
    case TemplateArgument::Expression:
178
34.8k
      AddStmt(TA.getAsExpr());
179
34.8k
      break;
180
514
    case TemplateArgument::Pack:
181
514
      ID.AddInteger(TA.pack_size());
182
696
      for (auto SubTA : TA.pack_elements()) {
183
696
        AddTemplateArgument(SubTA);
184
696
      }
185
514
      break;
186
485k
  }
187
485k
}
188
189
18.4k
void ODRHash::AddTemplateParameterList(const TemplateParameterList *TPL) {
190
18.4k
  assert(TPL && "Expecting non-null pointer.");
191
192
18.4k
  ID.AddInteger(TPL->size());
193
27.0k
  for (auto *ND : TPL->asArray()) {
194
27.0k
    AddSubDecl(ND);
195
27.0k
  }
196
18.4k
}
197
198
957
void ODRHash::clear() {
199
957
  DeclNameMap.clear();
200
957
  Bools.clear();
201
957
  ID.clear();
202
957
}
203
204
589k
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
589k
  const unsigned unsigned_bits = sizeof(unsigned) * CHAR_BIT;
209
589k
  const unsigned size = Bools.size();
210
589k
  const unsigned remainder = size % unsigned_bits;
211
589k
  const unsigned loops = size / unsigned_bits;
212
589k
  auto I = Bools.rbegin();
213
589k
  unsigned value = 0;
214
7.86M
  for (unsigned i = 0; i < remainder; 
++i7.28M
) {
215
7.28M
    value <<= 1;
216
7.28M
    value |= *I;
217
7.28M
    ++I;
218
7.28M
  }
219
589k
  ID.AddInteger(value);
220
221
1.15M
  for (unsigned i = 0; i < loops; 
++i570k
) {
222
570k
    value = 0;
223
18.8M
    for (unsigned j = 0; j < unsigned_bits; 
++j18.2M
) {
224
18.2M
      value <<= 1;
225
18.2M
      value |= *I;
226
18.2M
      ++I;
227
18.2M
    }
228
570k
    ID.AddInteger(value);
229
570k
  }
230
231
589k
  assert(I == Bools.rend());
232
589k
  Bools.clear();
233
589k
  return ID.ComputeHash();
234
589k
}
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.22M
      : ID(ID), Hash(Hash) {}
247
248
361k
  void AddStmt(const Stmt *S) {
249
361k
    Hash.AddBoolean(S);
250
361k
    if (S) {
251
234k
      Hash.AddStmt(S);
252
234k
    }
253
361k
  }
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.12M
  void AddQualType(QualType T) {
263
1.12M
    Hash.AddQualType(T);
264
1.12M
  }
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.07k
  void AddTemplateArgument(TemplateArgument TA) {
274
2.07k
    Hash.AddTemplateArgument(TA);
275
2.07k
  }
276
277
1.22M
  void Visit(const Decl *D) {
278
1.22M
    ID.AddInteger(D->getKind());
279
1.22M
    Inherited::Visit(D);
280
1.22M
  }
281
282
1.21M
  void VisitNamedDecl(const NamedDecl *D) {
283
1.21M
    Hash.AddDeclarationName(D->getDeclName());
284
1.21M
    Inherited::VisitNamedDecl(D);
285
1.21M
  }
286
287
1.15M
  void VisitValueDecl(const ValueDecl *D) {
288
1.15M
    if (!isa<FunctionDecl>(D)) {
289
1.10M
      AddQualType(D->getType());
290
1.10M
    }
291
1.15M
    Inherited::VisitValueDecl(D);
292
1.15M
  }
293
294
803k
  void VisitVarDecl(const VarDecl *D) {
295
803k
    Hash.AddBoolean(D->isStaticLocal());
296
803k
    Hash.AddBoolean(D->isConstexpr());
297
803k
    const bool HasInit = D->hasInit();
298
803k
    Hash.AddBoolean(HasInit);
299
803k
    if (HasInit) {
300
58.4k
      AddStmt(D->getInit());
301
58.4k
    }
302
803k
    Inherited::VisitVarDecl(D);
303
803k
  }
304
305
739k
  void VisitParmVarDecl(const ParmVarDecl *D) {
306
    // TODO: Handle default arguments.
307
739k
    Inherited::VisitParmVarDecl(D);
308
739k
  }
309
310
9.62k
  void VisitAccessSpecDecl(const AccessSpecDecl *D) {
311
9.62k
    ID.AddInteger(D->getAccess());
312
9.62k
    Inherited::VisitAccessSpecDecl(D);
313
9.62k
  }
314
315
2.45k
  void VisitStaticAssertDecl(const StaticAssertDecl *D) {
316
2.45k
    AddStmt(D->getAssertExpr());
317
2.45k
    AddStmt(D->getMessage());
318
319
2.45k
    Inherited::VisitStaticAssertDecl(D);
320
2.45k
  }
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.2k
  void VisitFunctionDecl(const FunctionDecl *D) {
337
    // Handled by the ODRHash for FunctionDecl
338
53.2k
    ID.AddInteger(D->getODRHash());
339
340
53.2k
    Inherited::VisitFunctionDecl(D);
341
53.2k
  }
342
343
53.2k
  void VisitCXXMethodDecl(const CXXMethodDecl *D) {
344
    // Handled by the ODRHash for FunctionDecl
345
346
53.2k
    Inherited::VisitCXXMethodDecl(D);
347
53.2k
  }
348
349
22.5k
  void VisitTypedefNameDecl(const TypedefNameDecl *D) {
350
22.5k
    AddQualType(D->getUnderlyingType());
351
352
22.5k
    Inherited::VisitTypedefNameDecl(D);
353
22.5k
  }
354
355
21.7k
  void VisitTypedefDecl(const TypedefDecl *D) {
356
21.7k
    Inherited::VisitTypedefDecl(D);
357
21.7k
  }
358
359
808
  void VisitTypeAliasDecl(const TypeAliasDecl *D) {
360
808
    Inherited::VisitTypeAliasDecl(D);
361
808
  }
362
363
5.31k
  void VisitFriendDecl(const FriendDecl *D) {
364
5.31k
    TypeSourceInfo *TSI = D->getFriendType();
365
5.31k
    Hash.AddBoolean(TSI);
366
5.31k
    if (TSI) {
367
450
      AddQualType(TSI->getType());
368
4.86k
    } else {
369
4.86k
      AddDecl(D->getFriendDecl());
370
4.86k
    }
371
5.31k
  }
372
373
23.1k
  void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D) {
374
    // Only care about default arguments as part of the definition.
375
23.1k
    const bool hasDefaultArgument =
376
23.1k
        D->hasDefaultArgument() && 
!D->defaultArgumentWasInherited()2.36k
;
377
23.1k
    Hash.AddBoolean(hasDefaultArgument);
378
23.1k
    if (hasDefaultArgument) {
379
2.03k
      AddTemplateArgument(D->getDefaultArgument());
380
2.03k
    }
381
23.1k
    Hash.AddBoolean(D->isParameterPack());
382
383
23.1k
    const TypeConstraint *TC = D->getTypeConstraint();
384
23.1k
    Hash.AddBoolean(TC != nullptr);
385
23.1k
    if (TC)
386
6
      AddStmt(TC->getImmediatelyDeclaredConstraint());
387
388
23.1k
    Inherited::VisitTemplateTypeParmDecl(D);
389
23.1k
  }
390
391
3.76k
  void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D) {
392
    // Only care about default arguments as part of the definition.
393
3.76k
    const bool hasDefaultArgument =
394
3.76k
        D->hasDefaultArgument() && 
!D->defaultArgumentWasInherited()1.60k
;
395
3.76k
    Hash.AddBoolean(hasDefaultArgument);
396
3.76k
    if (hasDefaultArgument) {
397
1.58k
      AddStmt(D->getDefaultArgument());
398
1.58k
    }
399
3.76k
    Hash.AddBoolean(D->isParameterPack());
400
401
3.76k
    Inherited::VisitNonTypeTemplateParmDecl(D);
402
3.76k
  }
403
404
182
  void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D) {
405
    // Only care about default arguments as part of the definition.
406
182
    const bool hasDefaultArgument =
407
182
        D->hasDefaultArgument() && 
!D->defaultArgumentWasInherited()40
;
408
182
    Hash.AddBoolean(hasDefaultArgument);
409
182
    if (hasDefaultArgument) {
410
40
      AddTemplateArgument(D->getDefaultArgument().getArgument());
411
40
    }
412
182
    Hash.AddBoolean(D->isParameterPack());
413
414
182
    Inherited::VisitTemplateTemplateParmDecl(D);
415
182
  }
416
417
9.22k
  void VisitTemplateDecl(const TemplateDecl *D) {
418
9.22k
    Hash.AddTemplateParameterList(D->getTemplateParameters());
419
420
9.22k
    Inherited::VisitTemplateDecl(D);
421
9.22k
  }
422
423
9.04k
  void VisitRedeclarableTemplateDecl(const RedeclarableTemplateDecl *D) {
424
9.04k
    Hash.AddBoolean(D->isMemberSpecialization());
425
9.04k
    Inherited::VisitRedeclarableTemplateDecl(D);
426
9.04k
  }
427
428
9.04k
  void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
429
9.04k
    AddDecl(D->getTemplatedDecl());
430
9.04k
    ID.AddInteger(D->getTemplatedDecl()->getODRHash());
431
9.04k
    Inherited::VisitFunctionTemplateDecl(D);
432
9.04k
  }
433
434
175k
  void VisitEnumConstantDecl(const EnumConstantDecl *D) {
435
175k
    AddStmt(D->getInitExpr());
436
175k
    Inherited::VisitEnumConstantDecl(D);
437
175k
  }
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
834k
bool ODRHash::isDeclToBeProcessed(const Decl *D, const DeclContext *Parent) {
444
834k
  if (D->isImplicit()) 
return false100k
;
445
734k
  if (D->getDeclContext() != Parent) 
return false1.43k
;
446
447
732k
  switch (D->getKind()) {
448
271k
    default:
449
271k
      return false;
450
461k
    case Decl::AccessSpec:
451
461k
    case Decl::CXXConstructor:
452
461k
    case Decl::CXXDestructor:
453
461k
    case Decl::CXXMethod:
454
461k
    case Decl::EnumConstant: // Only found in EnumDecl's.
455
461k
    case Decl::Field:
456
461k
    case Decl::Friend:
457
461k
    case Decl::FunctionTemplate:
458
461k
    case Decl::StaticAssert:
459
461k
    case Decl::TypeAlias:
460
461k
    case Decl::Typedef:
461
461k
    case Decl::Var:
462
461k
      return true;
463
732k
  }
464
732k
}
465
466
1.22M
void ODRHash::AddSubDecl(const Decl *D) {
467
1.22M
  assert(D && "Expecting non-null pointer.");
468
469
1.22M
  ODRDeclVisitor(ID, *this).Visit(D);
470
1.22M
}
471
472
114k
void ODRHash::AddCXXRecordDecl(const CXXRecordDecl *Record) {
473
114k
  assert(Record && Record->hasDefinition() &&
474
114k
         "Expected non-null record to be a definition.");
475
476
114k
  const DeclContext *DC = Record;
477
371k
  while (DC) {
478
305k
    if (isa<ClassTemplateSpecializationDecl>(DC)) {
479
48.8k
      return;
480
48.8k
    }
481
256k
    DC = DC->getParent();
482
256k
  }
483
484
65.5k
  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
65.5k
  llvm::SmallVector<const Decl *, 16> Decls;
489
293k
  for (Decl *SubDecl : Record->decls()) {
490
293k
    if (isDeclToBeProcessed(SubDecl, Record)) {
491
215k
      Decls.push_back(SubDecl);
492
215k
      if (auto *Function = dyn_cast<FunctionDecl>(SubDecl)) {
493
        // Compute/Preload ODRHash into FunctionDecl.
494
53.0k
        Function->getODRHash();
495
53.0k
      }
496
215k
    }
497
293k
  }
498
499
65.5k
  ID.AddInteger(Decls.size());
500
215k
  for (auto SubDecl : Decls) {
501
215k
    AddSubDecl(SubDecl);
502
215k
  }
503
504
65.5k
  const ClassTemplateDecl *TD = Record->getDescribedClassTemplate();
505
65.5k
  AddBoolean(TD);
506
65.5k
  if (TD) {
507
9.17k
    AddTemplateParameterList(TD->getTemplateParameters());
508
9.17k
  }
509
510
65.5k
  ID.AddInteger(Record->getNumBases());
511
65.5k
  auto Bases = Record->bases();
512
4.77k
  for (auto Base : Bases) {
513
4.77k
    AddQualType(Base.getType());
514
4.77k
    ID.AddInteger(Base.isVirtual());
515
4.77k
    ID.AddInteger(Base.getAccessSpecifierAsWritten());
516
4.77k
  }
517
65.5k
}
518
519
void ODRHash::AddFunctionDecl(const FunctionDecl *Function,
520
449k
                              bool SkipBody) {
521
449k
  assert(Function && "Expecting non-null pointer.");
522
523
  // Skip functions that are specializations or in specialization context.
524
449k
  const DeclContext *DC = Function;
525
1.75M
  while (DC) {
526
1.35M
    if (isa<ClassTemplateSpecializationDecl>(DC)) 
return45.4k
;
527
1.31M
    if (auto *F = dyn_cast<FunctionDecl>(DC)) {
528
452k
      if (F->isFunctionTemplateSpecialization()) {
529
12.1k
        if (!isa<CXXMethodDecl>(DC)) 
return6.60k
;
530
5.59k
        if (DC->getLexicalParent()->isFileContext()) 
return31
;
531
        // Inline method specializations are the only supported
532
        // specialization for now.
533
5.59k
      }
534
452k
    }
535
1.30M
    DC = DC->getParent();
536
1.30M
  }
537
538
397k
  ID.AddInteger(Function->getDeclKind());
539
540
397k
  const auto *SpecializationArgs = Function->getTemplateSpecializationArgs();
541
397k
  AddBoolean(SpecializationArgs);
542
397k
  if (SpecializationArgs) {
543
3.12k
    ID.AddInteger(SpecializationArgs->size());
544
3.40k
    for (const TemplateArgument &TA : SpecializationArgs->asArray()) {
545
3.40k
      AddTemplateArgument(TA);
546
3.40k
    }
547
3.12k
  }
548
549
397k
  if (const auto *Method = dyn_cast<CXXMethodDecl>(Function)) {
550
89.4k
    AddBoolean(Method->isConst());
551
89.4k
    AddBoolean(Method->isVolatile());
552
89.4k
  }
553
554
397k
  ID.AddInteger(Function->getStorageClass());
555
397k
  AddBoolean(Function->isInlineSpecified());
556
397k
  AddBoolean(Function->isVirtualAsWritten());
557
397k
  AddBoolean(Function->isPure());
558
397k
  AddBoolean(Function->isDeletedAsWritten());
559
397k
  AddBoolean(Function->isExplicitlyDefaulted());
560
561
397k
  AddDecl(Function);
562
563
397k
  AddQualType(Function->getReturnType());
564
565
397k
  ID.AddInteger(Function->param_size());
566
397k
  for (auto Param : Function->parameters())
567
739k
    AddSubDecl(Param);
568
569
397k
  if (SkipBody) {
570
14
    AddBoolean(false);
571
14
    return;
572
14
  }
573
574
397k
  const bool HasBody = Function->isThisDeclarationADefinition() &&
575
160k
                       !Function->isDefaulted() && 
!Function->isDeleted()150k
&&
576
150k
                       !Function->isLateTemplateParsed();
577
397k
  AddBoolean(HasBody);
578
397k
  if (!HasBody) {
579
247k
    return;
580
247k
  }
581
582
150k
  auto *Body = Function->getBody();
583
150k
  AddBoolean(Body);
584
150k
  if (Body)
585
150k
    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
150k
  llvm::SmallVector<const Decl *, 16> Decls;
590
364k
  for (Decl *SubDecl : Function->decls()) {
591
364k
    if (isDeclToBeProcessed(SubDecl, Function)) {
592
70.1k
      Decls.push_back(SubDecl);
593
70.1k
    }
594
364k
  }
595
596
150k
  ID.AddInteger(Decls.size());
597
70.1k
  for (auto SubDecl : Decls) {
598
70.1k
    AddSubDecl(SubDecl);
599
70.1k
  }
600
150k
}
601
602
24.0k
void ODRHash::AddEnumDecl(const EnumDecl *Enum) {
603
24.0k
  assert(Enum);
604
24.0k
  AddDeclarationName(Enum->getDeclName());
605
606
24.0k
  AddBoolean(Enum->isScoped());
607
24.0k
  if (Enum->isScoped())
608
217
    AddBoolean(Enum->isScopedUsingClassTag());
609
610
24.0k
  if (Enum->getIntegerTypeSourceInfo())
611
6.66k
    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
24.0k
  llvm::SmallVector<const Decl *, 16> Decls;
616
175k
  for (Decl *SubDecl : Enum->decls()) {
617
175k
    if (isDeclToBeProcessed(SubDecl, Enum)) {
618
175k
      assert(isa<EnumConstantDecl>(SubDecl) && "Unexpected Decl");
619
175k
      Decls.push_back(SubDecl);
620
175k
    }
621
175k
  }
622
623
24.0k
  ID.AddInteger(Decls.size());
624
175k
  for (auto SubDecl : Decls) {
625
175k
    AddSubDecl(SubDecl);
626
175k
  }
627
628
24.0k
}
629
630
3.89M
void ODRHash::AddDecl(const Decl *D) {
631
3.89M
  assert(D && "Expecting non-null pointer.");
632
3.89M
  D = D->getCanonicalDecl();
633
634
3.89M
  const NamedDecl *ND = dyn_cast<NamedDecl>(D);
635
3.89M
  AddBoolean(ND);
636
3.89M
  if (!ND) {
637
1.53k
    ID.AddInteger(D->getKind());
638
1.53k
    return;
639
1.53k
  }
640
641
3.89M
  AddDeclarationName(ND->getDeclName());
642
643
3.89M
  const auto *Specialization =
644
3.89M
            dyn_cast<ClassTemplateSpecializationDecl>(D);
645
3.89M
  AddBoolean(Specialization);
646
3.89M
  if (Specialization) {
647
10.0k
    const TemplateArgumentList &List = Specialization->getTemplateArgs();
648
10.0k
    ID.AddInteger(List.size());
649
10.0k
    for (const TemplateArgument &TA : List.asArray())
650
17.9k
      AddTemplateArgument(TA);
651
10.0k
  }
652
3.89M
}
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
5.16M
      : ID(ID), Hash(Hash) {}
665
666
4.24k
  void AddStmt(Stmt *S) {
667
4.24k
    Hash.AddBoolean(S);
668
4.24k
    if (S) {
669
4.23k
      Hash.AddStmt(S);
670
4.23k
    }
671
4.24k
  }
672
673
2.20M
  void AddDecl(Decl *D) {
674
2.20M
    Hash.AddBoolean(D);
675
2.20M
    if (D) {
676
2.20M
      Hash.AddDecl(D);
677
2.20M
    }
678
2.20M
  }
679
680
1.30M
  void AddQualType(QualType T) {
681
1.30M
    Hash.AddQualType(T);
682
1.30M
  }
683
684
1.39M
  void AddType(const Type *T) {
685
1.39M
    Hash.AddBoolean(T);
686
1.39M
    if (T) {
687
1.39M
      Hash.AddType(T);
688
1.39M
    }
689
1.39M
  }
690
691
253k
  void AddNestedNameSpecifier(const NestedNameSpecifier *NNS) {
692
253k
    Hash.AddBoolean(NNS);
693
253k
    if (NNS) {
694
148k
      Hash.AddNestedNameSpecifier(NNS);
695
148k
    }
696
253k
  }
697
698
138k
  void AddIdentifierInfo(const IdentifierInfo *II) {
699
138k
    Hash.AddBoolean(II);
700
138k
    if (II) {
701
138k
      Hash.AddIdentifierInfo(II);
702
138k
    }
703
138k
  }
704
705
1.40M
  void VisitQualifiers(Qualifiers Quals) {
706
1.40M
    ID.AddInteger(Quals.getAsOpaqueValue());
707
1.40M
  }
708
709
  // Return the RecordType if the typedef only strips away a keyword.
710
  // Otherwise, return the original type.
711
5.16M
  static const Type *RemoveTypedef(const Type *T) {
712
5.16M
    const auto *TypedefT = dyn_cast<TypedefType>(T);
713
5.16M
    if (!TypedefT) {
714
3.75M
      return T;
715
3.75M
    }
716
717
1.40M
    const TypedefNameDecl *D = TypedefT->getDecl();
718
1.40M
    QualType UnderlyingType = D->getUnderlyingType();
719
720
1.40M
    if (UnderlyingType.hasLocalQualifiers()) {
721
119
      return T;
722
119
    }
723
724
1.40M
    const auto *ElaboratedT = dyn_cast<ElaboratedType>(UnderlyingType);
725
1.40M
    if (!ElaboratedT) {
726
1.32M
      return T;
727
1.32M
    }
728
729
82.6k
    if (ElaboratedT->getQualifier() != nullptr) {
730
9.27k
      return T;
731
9.27k
    }
732
733
73.3k
    QualType NamedType = ElaboratedT->getNamedType();
734
73.3k
    if (NamedType.hasLocalQualifiers()) {
735
0
      return T;
736
0
    }
737
738
73.3k
    const auto *RecordT = dyn_cast<RecordType>(NamedType);
739
73.3k
    if (!RecordT) {
740
7.31k
      return T;
741
7.31k
    }
742
743
66.0k
    const IdentifierInfo *TypedefII = TypedefT->getDecl()->getIdentifier();
744
66.0k
    const IdentifierInfo *RecordII = RecordT->getDecl()->getIdentifier();
745
66.0k
    if (!TypedefII || !RecordII ||
746
48.2k
        
TypedefII->getName() != RecordII->getName()34.5k
) {
747
48.2k
      return T;
748
48.2k
    }
749
750
17.7k
    return RecordT;
751
17.7k
  }
752
753
5.16M
  void Visit(const Type *T) {
754
5.16M
    T = RemoveTypedef(T);
755
5.16M
    ID.AddInteger(T->getTypeClass());
756
5.16M
    Inherited::Visit(T);
757
5.16M
  }
758
759
4.75M
  void VisitType(const Type *T) {}
760
761
4.25k
  void VisitAdjustedType(const AdjustedType *T) {
762
4.25k
    QualType Original = T->getOriginalType();
763
4.25k
    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
4.25k
    SplitQualType split = Adjusted.split();
769
4.25k
    if (auto Pointer = dyn_cast<PointerType>(split.Ty)) {
770
3.96k
      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
4.04k
    }
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
4.04k
    Hash.AddBoolean(false);
783
4.04k
    AddQualType(Original);
784
4.04k
    AddQualType(Adjusted);
785
786
4.04k
    VisitType(T);
787
4.04k
  }
788
789
4.25k
  void VisitDecayedType(const DecayedType *T) {
790
    // getDecayedType and getPointeeType are derived from getAdjustedType
791
    // and don't need to be separately processed.
792
4.25k
    VisitAdjustedType(T);
793
4.25k
  }
794
795
17.9k
  void VisitArrayType(const ArrayType *T) {
796
17.9k
    AddQualType(T->getElementType());
797
17.9k
    ID.AddInteger(T->getSizeModifier());
798
17.9k
    VisitQualifiers(T->getIndexTypeQualifiers());
799
17.9k
    VisitType(T);
800
17.9k
  }
801
13.5k
  void VisitConstantArrayType(const ConstantArrayType *T) {
802
13.5k
    T->getSize().Profile(ID);
803
13.5k
    VisitArrayType(T);
804
13.5k
  }
805
806
806
  void VisitDependentSizedArrayType(const DependentSizedArrayType *T) {
807
806
    AddStmt(T->getSizeExpr());
808
806
    VisitArrayType(T);
809
806
  }
810
811
2.08k
  void VisitIncompleteArrayType(const IncompleteArrayType *T) {
812
2.08k
    VisitArrayType(T);
813
2.08k
  }
814
815
1.44k
  void VisitVariableArrayType(const VariableArrayType *T) {
816
1.44k
    AddStmt(T->getSizeExpr());
817
1.44k
    VisitArrayType(T);
818
1.44k
  }
819
820
54.7k
  void VisitAttributedType(const AttributedType *T) {
821
54.7k
    ID.AddInteger(T->getAttrKind());
822
54.7k
    AddQualType(T->getModifiedType());
823
54.7k
    AddQualType(T->getEquivalentType());
824
825
54.7k
    VisitType(T);
826
54.7k
  }
827
828
1.92k
  void VisitBlockPointerType(const BlockPointerType *T) {
829
1.92k
    AddQualType(T->getPointeeType());
830
1.92k
    VisitType(T);
831
1.92k
  }
832
833
1.35M
  void VisitBuiltinType(const BuiltinType *T) {
834
1.35M
    ID.AddInteger(T->getKind());
835
1.35M
    VisitType(T);
836
1.35M
  }
837
838
4.59k
  void VisitComplexType(const ComplexType *T) {
839
4.59k
    AddQualType(T->getElementType());
840
4.59k
    VisitType(T);
841
4.59k
  }
842
843
1.94k
  void VisitDecltypeType(const DecltypeType *T) {
844
1.94k
    AddStmt(T->getUnderlyingExpr());
845
1.94k
    AddQualType(T->getUnderlyingType());
846
1.94k
    VisitType(T);
847
1.94k
  }
848
849
0
  void VisitDependentDecltypeType(const DependentDecltypeType *T) {
850
0
    VisitDecltypeType(T);
851
0
  }
852
853
775
  void VisitDeducedType(const DeducedType *T) {
854
775
    AddQualType(T->getDeducedType());
855
775
    VisitType(T);
856
775
  }
857
858
768
  void VisitAutoType(const AutoType *T) {
859
768
    ID.AddInteger((unsigned)T->getKeyword());
860
768
    ID.AddInteger(T->isConstrained());
861
768
    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
768
    VisitDeducedType(T);
868
768
  }
869
870
  void VisitDeducedTemplateSpecializationType(
871
7
      const DeducedTemplateSpecializationType *T) {
872
7
    Hash.AddTemplateName(T->getTemplateName());
873
7
    VisitDeducedType(T);
874
7
  }
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
24.5k
  void VisitFunctionType(const FunctionType *T) {
889
24.5k
    AddQualType(T->getReturnType());
890
24.5k
    T->getExtInfo().Profile(ID);
891
24.5k
    Hash.AddBoolean(T->isConst());
892
24.5k
    Hash.AddBoolean(T->isVolatile());
893
24.5k
    Hash.AddBoolean(T->isRestrict());
894
24.5k
    VisitType(T);
895
24.5k
  }
896
897
3
  void VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
898
3
    VisitFunctionType(T);
899
3
  }
900
901
24.5k
  void VisitFunctionProtoType(const FunctionProtoType *T) {
902
24.5k
    ID.AddInteger(T->getNumParams());
903
24.5k
    for (auto ParamType : T->getParamTypes())
904
63.6k
      AddQualType(ParamType);
905
906
24.5k
    VisitFunctionType(T);
907
24.5k
  }
908
909
38.6k
  void VisitInjectedClassNameType(const InjectedClassNameType *T) {
910
38.6k
    AddDecl(T->getDecl());
911
38.6k
    VisitType(T);
912
38.6k
  }
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
9.80k
  void VisitObjCObjectPointerType(const ObjCObjectPointerType *T) {
921
9.80k
    AddQualType(T->getPointeeType());
922
9.80k
    VisitType(T);
923
9.80k
  }
924
925
9.82k
  void VisitObjCObjectType(const ObjCObjectType *T) {
926
9.82k
    AddDecl(T->getInterface());
927
928
9.82k
    auto TypeArgs = T->getTypeArgsAsWritten();
929
9.82k
    ID.AddInteger(TypeArgs.size());
930
52
    for (auto Arg : TypeArgs) {
931
52
      AddQualType(Arg);
932
52
    }
933
934
9.82k
    auto Protocols = T->getProtocols();
935
9.82k
    ID.AddInteger(Protocols.size());
936
5.10k
    for (auto Protocol : Protocols) {
937
5.10k
      AddDecl(Protocol);
938
5.10k
    }
939
940
9.82k
    Hash.AddBoolean(T->isKindOfType());
941
942
9.82k
    VisitType(T);
943
9.82k
  }
944
945
1.88k
  void VisitObjCInterfaceType(const ObjCInterfaceType *T) {
946
    // This type is handled by the parent type ObjCObjectType.
947
1.88k
    VisitObjCObjectType(T);
948
1.88k
  }
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
7
    for (auto Protocol : Protocols) {
955
7
      AddDecl(Protocol);
956
7
    }
957
958
8
    VisitType(T);
959
8
  }
960
961
4.45k
  void VisitPackExpansionType(const PackExpansionType *T) {
962
4.45k
    AddQualType(T->getPattern());
963
4.45k
    VisitType(T);
964
4.45k
  }
965
966
23.9k
  void VisitParenType(const ParenType *T) {
967
23.9k
    AddQualType(T->getInnerType());
968
23.9k
    VisitType(T);
969
23.9k
  }
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
361k
  void VisitPointerType(const PointerType *T) {
978
361k
    AddQualType(T->getPointeeType());
979
361k
    VisitType(T);
980
361k
  }
981
982
94.6k
  void VisitReferenceType(const ReferenceType *T) {
983
94.6k
    AddQualType(T->getPointeeTypeAsWritten());
984
94.6k
    VisitType(T);
985
94.6k
  }
986
987
83.2k
  void VisitLValueReferenceType(const LValueReferenceType *T) {
988
83.2k
    VisitReferenceType(T);
989
83.2k
  }
990
991
11.4k
  void VisitRValueReferenceType(const RValueReferenceType *T) {
992
11.4k
    VisitReferenceType(T);
993
11.4k
  }
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
3.48k
  void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) {
1003
3.48k
    AddType(T->getReplacedParameter());
1004
3.48k
    AddQualType(T->getReplacementType());
1005
3.48k
    VisitType(T);
1006
3.48k
  }
1007
1008
353k
  void VisitTagType(const TagType *T) {
1009
353k
    AddDecl(T->getDecl());
1010
353k
    VisitType(T);
1011
353k
  }
1012
1013
261k
  void VisitRecordType(const RecordType *T) { VisitTagType(T); }
1014
92.2k
  void VisitEnumType(const EnumType *T) { VisitTagType(T); }
1015
1016
277k
  void VisitTemplateSpecializationType(const TemplateSpecializationType *T) {
1017
277k
    ID.AddInteger(T->getNumArgs());
1018
461k
    for (const auto &TA : T->template_arguments()) {
1019
461k
      Hash.AddTemplateArgument(TA);
1020
461k
    }
1021
277k
    Hash.AddTemplateName(T->getTemplateName());
1022
277k
    VisitType(T);
1023
277k
  }
1024
1025
411k
  void VisitTemplateTypeParmType(const TemplateTypeParmType *T) {
1026
411k
    ID.AddInteger(T->getDepth());
1027
411k
    ID.AddInteger(T->getIndex());
1028
411k
    Hash.AddBoolean(T->isParameterPack());
1029
411k
    AddDecl(T->getDecl());
1030
411k
  }
1031
1032
1.38M
  void VisitTypedefType(const TypedefType *T) {
1033
1.38M
    AddDecl(T->getDecl());
1034
1.38M
    QualType UnderlyingType = T->getDecl()->getUnderlyingType();
1035
1.38M
    VisitQualifiers(UnderlyingType.getQualifiers());
1036
1.68M
    while (true) {
1037
1.68M
      if (const TypedefType *Underlying =
1038
220k
              dyn_cast<TypedefType>(UnderlyingType.getTypePtr())) {
1039
220k
        UnderlyingType = Underlying->getDecl()->getUnderlyingType();
1040
220k
        continue;
1041
220k
      }
1042
1.45M
      if (const ElaboratedType *Underlying =
1043
72.0k
              dyn_cast<ElaboratedType>(UnderlyingType.getTypePtr())) {
1044
72.0k
        UnderlyingType = Underlying->getNamedType();
1045
72.0k
        continue;
1046
72.0k
      }
1047
1048
1.38M
      break;
1049
1.38M
    }
1050
1.38M
    AddType(UnderlyingType.getTypePtr());
1051
1.38M
    VisitType(T);
1052
1.38M
  }
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
253k
  void VisitTypeWithKeyword(const TypeWithKeyword *T) {
1068
253k
    ID.AddInteger(T->getKeyword());
1069
253k
    VisitType(T);
1070
253k
  };
1071
1072
138k
  void VisitDependentNameType(const DependentNameType *T) {
1073
138k
    AddNestedNameSpecifier(T->getQualifier());
1074
138k
    AddIdentifierInfo(T->getIdentifier());
1075
138k
    VisitTypeWithKeyword(T);
1076
138k
  }
1077
1078
  void VisitDependentTemplateSpecializationType(
1079
144
      const DependentTemplateSpecializationType *T) {
1080
144
    AddIdentifierInfo(T->getIdentifier());
1081
144
    AddNestedNameSpecifier(T->getQualifier());
1082
144
    ID.AddInteger(T->getNumArgs());
1083
144
    for (const auto &TA : T->template_arguments()) {
1084
144
      Hash.AddTemplateArgument(TA);
1085
144
    }
1086
144
    VisitTypeWithKeyword(T);
1087
144
  }
1088
1089
114k
  void VisitElaboratedType(const ElaboratedType *T) {
1090
114k
    AddNestedNameSpecifier(T->getQualifier());
1091
114k
    AddQualType(T->getNamedType());
1092
114k
    VisitTypeWithKeyword(T);
1093
114k
  }
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
462k
  void VisitVectorType(const VectorType *T) {
1107
462k
    AddQualType(T->getElementType());
1108
462k
    ID.AddInteger(T->getNumElements());
1109
462k
    ID.AddInteger(T->getVectorKind());
1110
462k
    VisitType(T);
1111
462k
  }
1112
1113
126k
  void VisitExtVectorType(const ExtVectorType * T) {
1114
126k
    VisitVectorType(T);
1115
126k
  }
1116
};
1117
} // namespace
1118
1119
5.16M
void ODRHash::AddType(const Type *T) {
1120
5.16M
  assert(T && "Expecting non-null pointer.");
1121
5.16M
  ODRTypeVisitor(ID, *this).Visit(T);
1122
5.16M
}
1123
1124
3.57M
void ODRHash::AddQualType(QualType T) {
1125
3.57M
  AddBoolean(T.isNull());
1126
3.57M
  if (T.isNull())
1127
1.15k
    return;
1128
3.57M
  SplitQualType split = T.split();
1129
3.57M
  ID.AddInteger(split.Quals.getAsOpaqueValue());
1130
3.57M
  AddType(split.Ty);
1131
3.57M
}
1132
1133
25.5M
void ODRHash::AddBoolean(bool Value) {
1134
25.5M
  Bools.push_back(Value);
1135
25.5M
}