// Save booleans until the end to lower the size of data to process.
void AddBoolean(bool value);
- static bool isWhitelistedDecl(const Decl* D, const DeclContext *Parent);
+ static bool isDeclToBeProcessed(const Decl* D, const DeclContext *Parent);
private:
void AddDeclarationNameImpl(DeclarationName Name);
// Only allow a small portion of Decl's to be processed. Remove this once
// all Decl's can be handled.
-bool ODRHash::isWhitelistedDecl(const Decl *D, const DeclContext *Parent) {
+bool ODRHash::isDeclToBeProcessed(const Decl *D, const DeclContext *Parent) {
if (D->isImplicit()) return false;
if (D->getDeclContext() != Parent) return false;
// accurate count of Decl's.
llvm::SmallVector<const Decl *, 16> Decls;
for (Decl *SubDecl : Record->decls()) {
- if (isWhitelistedDecl(SubDecl, Record)) {
+ if (isDeclToBeProcessed(SubDecl, Record)) {
Decls.push_back(SubDecl);
if (auto *Function = dyn_cast<FunctionDecl>(SubDecl)) {
// Compute/Preload ODRHash into FunctionDecl.
// accurate count of Decl's.
llvm::SmallVector<const Decl *, 16> Decls;
for (Decl *SubDecl : Function->decls()) {
- if (isWhitelistedDecl(SubDecl, Function)) {
+ if (isDeclToBeProcessed(SubDecl, Function)) {
Decls.push_back(SubDecl);
}
}
// accurate count of Decl's.
llvm::SmallVector<const Decl *, 16> Decls;
for (Decl *SubDecl : Enum->decls()) {
- if (isWhitelistedDecl(SubDecl, Enum)) {
+ if (isDeclToBeProcessed(SubDecl, Enum)) {
assert(isa<EnumConstantDecl>(SubDecl) && "Unexpected Decl");
Decls.push_back(SubDecl);
}
// Used with err_module_odr_violation_mismatch_decl and
// note_module_odr_violation_mismatch_decl
- // This list should be the same Decl's as in ODRHash::isWhiteListedDecl
+ // This list should be the same Decl's as in ODRHash::isDeclToBeProcessed
enum ODRMismatchDecl {
EndOfClass,
PublicSpecifer,
RecordDecl *Record,
const DeclContext *DC) {
for (auto *D : Record->decls()) {
- if (!ODRHash::isWhitelistedDecl(D, DC))
+ if (!ODRHash::isDeclToBeProcessed(D, DC))
continue;
Hashes.emplace_back(D, ComputeSubDeclODRHash(D));
}
for (auto *D : Enum->decls()) {
// Due to decl merging, the first EnumDecl is the parent of
// Decls in both records.
- if (!ODRHash::isWhitelistedDecl(D, FirstEnum))
+ if (!ODRHash::isDeclToBeProcessed(D, FirstEnum))
continue;
assert(isa<EnumConstantDecl>(D) && "Unexpected Decl kind");
Hashes.emplace_back(cast<EnumConstantDecl>(D),