Skip to content

Commit c67419b

Browse files
committed
[ODRHash] Rename isDeclToBeProcessed to isSubDeclToBeProcessed. NFC intended.
The method is used only for sub-Decls, so reflect that in the name. (cherry picked from commit 37fdca2)
1 parent 57b95ab commit c67419b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

clang/include/clang/AST/ODRDiagsEmitter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ODRDiagsEmitter {
5959

6060
// Used with err_module_odr_violation_mismatch_decl and
6161
// note_module_odr_violation_mismatch_decl
62-
// This list should be the same Decl's as in ODRHash::isDeclToBeProcessed
62+
// This list should be the same Decl's as in ODRHash::isSubDeclToBeProcessed
6363
enum ODRMismatchDecl {
6464
EndOfClass,
6565
PublicSpecifer,

clang/include/clang/AST/ODRHash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ODRHash {
9393
// Save booleans until the end to lower the size of data to process.
9494
void AddBoolean(bool value);
9595

96-
static bool isDeclToBeProcessed(const Decl* D, const DeclContext *Parent);
96+
static bool isSubDeclToBeProcessed(const Decl *D, const DeclContext *Parent);
9797

9898
private:
9999
void AddDeclarationNameImpl(DeclarationName Name);

clang/lib/AST/ODRDiagsEmitter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ bool ODRDiagsEmitter::diagnoseMismatch(
571571
auto PopulateHashes = [](DeclHashes &Hashes, const RecordDecl *Record,
572572
const DeclContext *DC) {
573573
for (const Decl *D : Record->decls()) {
574-
if (!ODRHash::isDeclToBeProcessed(D, DC))
574+
if (!ODRHash::isSubDeclToBeProcessed(D, DC))
575575
continue;
576576
Hashes.emplace_back(D, computeODRHash(D));
577577
}
@@ -1279,7 +1279,7 @@ bool ODRDiagsEmitter::diagnoseMismatch(const RecordDecl *FirstRecord,
12791279
auto PopulateHashes = [](DeclHashes &Hashes, const RecordDecl *Record,
12801280
const DeclContext *DC) {
12811281
for (const Decl *D : Record->decls()) {
1282-
if (!ODRHash::isDeclToBeProcessed(D, DC))
1282+
if (!ODRHash::isSubDeclToBeProcessed(D, DC))
12831283
continue;
12841284
Hashes.emplace_back(D, computeODRHash(D));
12851285
}
@@ -1571,7 +1571,7 @@ bool ODRDiagsEmitter::diagnoseMismatch(const EnumDecl *FirstEnum,
15711571
for (const Decl *D : Enum->decls()) {
15721572
// Due to decl merging, the first EnumDecl is the parent of
15731573
// Decls in both records.
1574-
if (!ODRHash::isDeclToBeProcessed(D, FirstEnum))
1574+
if (!ODRHash::isSubDeclToBeProcessed(D, FirstEnum))
15751575
continue;
15761576
assert(isa<EnumConstantDecl>(D) && "Unexpected Decl kind");
15771577
Hashes.emplace_back(cast<EnumConstantDecl>(D), computeODRHash(D));

clang/lib/AST/ODRHash.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ class ODRDeclVisitor : public ConstDeclVisitor<ODRDeclVisitor> {
441441

442442
// Only allow a small portion of Decl's to be processed. Remove this once
443443
// all Decl's can be handled.
444-
bool ODRHash::isDeclToBeProcessed(const Decl *D, const DeclContext *Parent) {
444+
bool ODRHash::isSubDeclToBeProcessed(const Decl *D, const DeclContext *Parent) {
445445
if (D->isImplicit()) return false;
446446
if (D->getDeclContext() != Parent) return false;
447447

@@ -488,7 +488,7 @@ void ODRHash::AddCXXRecordDecl(const CXXRecordDecl *Record) {
488488
// accurate count of Decl's.
489489
llvm::SmallVector<const Decl *, 16> Decls;
490490
for (Decl *SubDecl : Record->decls()) {
491-
if (isDeclToBeProcessed(SubDecl, Record)) {
491+
if (isSubDeclToBeProcessed(SubDecl, Record)) {
492492
Decls.push_back(SubDecl);
493493
if (auto *Function = dyn_cast<FunctionDecl>(SubDecl)) {
494494
// Compute/Preload ODRHash into FunctionDecl.
@@ -526,7 +526,7 @@ void ODRHash::AddRecordDecl(const RecordDecl *Record) {
526526
// accurate count of Decl's.
527527
llvm::SmallVector<const Decl *, 16> Decls;
528528
for (Decl *SubDecl : Record->decls()) {
529-
if (isDeclToBeProcessed(SubDecl, Record))
529+
if (isSubDeclToBeProcessed(SubDecl, Record))
530530
Decls.push_back(SubDecl);
531531
}
532532

@@ -607,7 +607,7 @@ void ODRHash::AddFunctionDecl(const FunctionDecl *Function,
607607
// accurate count of Decl's.
608608
llvm::SmallVector<const Decl *, 16> Decls;
609609
for (Decl *SubDecl : Function->decls()) {
610-
if (isDeclToBeProcessed(SubDecl, Function)) {
610+
if (isSubDeclToBeProcessed(SubDecl, Function)) {
611611
Decls.push_back(SubDecl);
612612
}
613613
}
@@ -633,7 +633,7 @@ void ODRHash::AddEnumDecl(const EnumDecl *Enum) {
633633
// accurate count of Decl's.
634634
llvm::SmallVector<const Decl *, 16> Decls;
635635
for (Decl *SubDecl : Enum->decls()) {
636-
if (isDeclToBeProcessed(SubDecl, Enum)) {
636+
if (isSubDeclToBeProcessed(SubDecl, Enum)) {
637637
assert(isa<EnumConstantDecl>(SubDecl) && "Unexpected Decl");
638638
Decls.push_back(SubDecl);
639639
}

0 commit comments

Comments
 (0)