clang 10.0.0git

Public Member Functions | Static Public Member Functions | List of all members
clang::ODRHash Class Reference

`#include "clang/AST/ODRHash.h"`

## Public Member Functions
| ODRHash ()
void | AddCXXRecordDecl (const CXXRecordDecl *Record)
void | AddFunctionDecl (const FunctionDecl *Function, bool SkipBody=false)
void | AddEnumDecl (const EnumDecl *Enum)
void | AddSubDecl (const Decl *D)
void | clear ()
unsigned | CalculateHash ()
void | AddDecl (const Decl *D)
void | AddType (const Type *T)
void | AddQualType (QualType T)
void | AddStmt (const Stmt *S)
void | AddIdentifierInfo (const IdentifierInfo *II)
void | AddNestedNameSpecifier (const NestedNameSpecifier *NNS)
void | AddTemplateName (TemplateName Name)
void | AddDeclarationName (DeclarationName Name, bool TreatAsDecl=false)
void | AddTemplateArgument (TemplateArgument TA)
void | AddTemplateParameterList (const TemplateParameterList *TPL)
void | AddBoolean (bool value)

## Static Public Member Functions
static bool | isWhitelistedDecl (const Decl *D, const DeclContext *Parent)

## Detailed Description

Definition at line 41 of file ODRHash.h.

## Constructor & Destructor Documentation

## ◆ ODRHash()

clang::ODRHash::ODRHash | ( |  | ) |
| inline

Definition at line 52 of file ODRHash.h.

References AddCXXRecordDecl(), AddDecl(), AddEnumDecl(), AddFunctionDecl(), AddQualType(), AddStmt(), AddSubDecl(), AddType(), CalculateHash(), and clear().

## Member Function Documentation

## ◆ AddBoolean()

void ODRHash::AddBoolean | ( | bool | value | ) |

Definition at line 1133 of file ODRHash.cpp.

Referenced by AddCXXRecordDecl(), AddDecl(), AddEnumDecl(), AddFunctionDecl(), AddNestedNameSpecifier(), and AddQualType().

## ◆ AddCXXRecordDecl()

void ODRHash::AddCXXRecordDecl | ( | const CXXRecordDecl * | Record | ) |

Definition at line 472 of file ODRHash.cpp.

References AddBoolean(), AddDecl(), AddQualType(), AddSubDecl(), AddTemplateParameterList(), clang::CXXRecordDecl::bases(), clang::DeclContext::decls(), clang::CXXRecordDecl::getDescribedClassTemplate(), clang::CXXRecordDecl::getNumBases(), clang::DeclContext::getParent(), clang::TemplateDecl::getTemplateParameters(), clang::CXXRecordDecl::hasDefinition(), and isWhitelistedDecl().

Referenced by clang::CXXRecordDecl::getODRHash(), and ODRHash().

## ◆ AddDecl()

void ODRHash::AddDecl | ( | const Decl * | D | ) |

Definition at line 630 of file ODRHash.cpp.

References AddBoolean(), AddDeclarationName(), clang::Decl::getCanonicalDecl(), clang::NamedDecl::getDeclName(), and clang::Decl::getKind().

Referenced by AddCXXRecordDecl(), AddFunctionDecl(), AddNestedNameSpecifier(), AddTemplateArgument(), AddTemplateName(), and ODRHash().

## ◆ AddDeclarationName()

void ODRHash::AddDeclarationName | ( | DeclarationName | Name,
|  | bool | TreatAsDecl = `false`
| ) |  |

Definition at line 34 of file ODRHash.cpp.

Referenced by AddDecl(), and AddEnumDecl().

## ◆ AddEnumDecl()

void ODRHash::AddEnumDecl | ( | const EnumDecl * | Enum | ) |

Definition at line 602 of file ODRHash.cpp.

References AddBoolean(), AddDeclarationName(), AddQualType(), AddSubDecl(), clang::DeclContext::decls(), clang::NamedDecl::getDeclName(), clang::EnumDecl::getIntegerType(), clang::EnumDecl::getIntegerTypeSourceInfo(), clang::EnumDecl::isScoped(), clang::EnumDecl::isScopedUsingClassTag(), and isWhitelistedDecl().

Referenced by clang::EnumDecl::getODRHash(), and ODRHash().

## ◆ AddFunctionDecl()

void ODRHash::AddFunctionDecl | ( | const FunctionDecl * | Function,
|  | bool | SkipBody = `false`
| ) |  |

Definition at line 519 of file ODRHash.cpp.

References AddBoolean(), AddDecl(), AddQualType(), AddStmt(), AddSubDecl(), AddTemplateArgument(), clang::DeclContext::decls(), clang::FunctionDecl::getBody(), clang::DeclContext::getDeclKind(), clang::DeclContext::getLexicalParent(), clang::DeclContext::getParent(), clang::FunctionDecl::getReturnType(), clang::FunctionDecl::getStorageClass(), clang::FunctionDecl::getTemplateSpecializationArgs(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::isDeletedAsWritten(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::DeclContext::isFileContext(), clang::FunctionDecl::isInlineSpecified(), clang::FunctionDecl::isLateTemplateParsed(), clang::FunctionDecl::isPure(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isVirtualAsWritten(), isWhitelistedDecl(), clang::FunctionDecl::param_size(), and clang::FunctionDecl::parameters().

Referenced by clang::FunctionDecl::getODRHash(), and ODRHash().

## ◆ AddIdentifierInfo()

void ODRHash::AddIdentifierInfo | ( | const IdentifierInfo * | II | ) |

Definition at line 29 of file ODRHash.cpp.

References clang::IdentifierInfo::getName().

Referenced by AddNestedNameSpecifier().

## ◆ AddNestedNameSpecifier()

void ODRHash::AddNestedNameSpecifier | ( | const NestedNameSpecifier * | NNS | ) |

Definition at line 109 of file ODRHash.cpp.

References AddBoolean(), AddDecl(), AddIdentifierInfo(), AddType(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.

## ◆ AddQualType()

void ODRHash::AddQualType | ( | QualType | T | ) |

Definition at line 1124 of file ODRHash.cpp.

References AddBoolean(), AddType(), clang::Qualifiers::getAsOpaqueValue(), clang::QualType::isNull(), clang::SplitQualType::Quals, clang::QualType::split(), and clang::SplitQualType::Ty.

Referenced by AddCXXRecordDecl(), AddEnumDecl(), AddFunctionDecl(), AddTemplateArgument(), clang::ASTReader::getOwningModuleNameForDiagnostic(), and ODRHash().

## ◆ AddStmt()

void ODRHash::AddStmt | ( | const Stmt * | S | ) |

Definition at line 24 of file ODRHash.cpp.

Referenced by AddFunctionDecl(), AddTemplateArgument(), CalculateHash(), clang::ExplicitSpecifier::isEquivalent(), and ODRHash().

## ◆ AddSubDecl()

void ODRHash::AddSubDecl | ( | const Decl * | D | ) |

Definition at line 466 of file ODRHash.cpp.

Referenced by AddCXXRecordDecl(), AddEnumDecl(), AddFunctionDecl(), AddTemplateParameterList(), and ODRHash().

## ◆ AddTemplateArgument()

void ODRHash::AddTemplateArgument | ( | TemplateArgument | TA | ) |

Definition at line 157 of file ODRHash.cpp.

References AddDecl(), AddQualType(), AddStmt(), AddTemplateName(), clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgument::getAsDecl(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getKind(), clang::TemplateArgument::Integral, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_elements(), clang::TemplateArgument::pack_size(), clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.

Referenced by AddFunctionDecl().

## ◆ AddTemplateName()

void ODRHash::AddTemplateName | ( | TemplateName | Name | ) |

Definition at line 138 of file ODRHash.cpp.

References AddDecl(), clang::TemplateName::AssumedTemplate, clang::TemplateName::DependentTemplate, clang::TemplateName::getAsTemplateDecl(), clang::TemplateName::getKind(), clang::TemplateName::OverloadedTemplate, clang::TemplateName::QualifiedTemplate, clang::TemplateName::SubstTemplateTemplateParm, clang::TemplateName::SubstTemplateTemplateParmPack, and clang::TemplateName::Template.

Referenced by AddTemplateArgument().

## ◆ AddTemplateParameterList()

void ODRHash::AddTemplateParameterList | ( | const TemplateParameterList * | TPL | ) |

Definition at line 189 of file ODRHash.cpp.

References AddSubDecl(), clang::TemplateParameterList::asArray(), and clang::TemplateParameterList::size().

Referenced by AddCXXRecordDecl().

## ◆ AddType()

void ODRHash::AddType | ( | const Type * | T | ) |

Definition at line 1119 of file ODRHash.cpp.

Referenced by AddNestedNameSpecifier(), AddQualType(), and ODRHash().

## ◆ CalculateHash()

unsigned ODRHash::CalculateHash | ( |  | ) |

Definition at line 204 of file ODRHash.cpp.

References AddStmt(), CHAR_BIT, and remainder.

Referenced by clang::CXXRecordDecl::getODRHash(), clang::FunctionDecl::getODRHash(), clang::EnumDecl::getODRHash(), clang::ASTReader::getOwningModuleNameForDiagnostic(), clang::ExplicitSpecifier::isEquivalent(), and ODRHash().

## ◆ clear()

void ODRHash::clear | ( |  | ) |

Definition at line 198 of file ODRHash.cpp.

Referenced by clang::ASTReader::getOwningModuleNameForDiagnostic(), and ODRHash().

## ◆ isWhitelistedDecl()

bool ODRHash::isWhitelistedDecl | ( | const Decl * | D,
|  | const DeclContext * | Parent
| ) |  |
| static

Definition at line 443 of file ODRHash.cpp.

References clang::Decl::getDeclContext(), clang::Decl::getKind(), clang::Decl::isImplicit(), and Parent.

Referenced by AddCXXRecordDecl(), AddEnumDecl(), and AddFunctionDecl().

The documentation for this class was generated from the following files:

- include/clang/AST/ODRHash.h
- lib/AST/ODRHash.cpp