llvm/clang/lib/AST/ODRHash.cpp

//===-- ODRHash.cpp - Hashing to diagnose ODR failures ----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file implements the ODRHash class, which calculates a hash based
/// on AST nodes, which is stable across different runs.
///
//===----------------------------------------------------------------------===//

#include "clang/AST/ODRHash.h"

#include "clang/AST/DeclVisitor.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/TypeVisitor.h"

usingnamespaceclang;

void ODRHash::AddStmt(const Stmt *S) {}

void ODRHash::AddIdentifierInfo(const IdentifierInfo *II) {}

void ODRHash::AddDeclarationName(DeclarationName Name, bool TreatAsDecl) {}

void ODRHash::AddDeclarationNameImpl(DeclarationName Name) {}

void ODRHash::AddNestedNameSpecifier(const NestedNameSpecifier *NNS) {}

void ODRHash::AddTemplateName(TemplateName Name) {}

void ODRHash::AddTemplateArgument(TemplateArgument TA) {}

void ODRHash::AddTemplateParameterList(const TemplateParameterList *TPL) {}

void ODRHash::clear() {}

unsigned ODRHash::CalculateHash() {}

namespace {
// Process a Decl pointer.  Add* methods call back into ODRHash while Visit*
// methods process the relevant parts of the Decl.
class ODRDeclVisitor : public ConstDeclVisitor<ODRDeclVisitor> {};
} // namespace

// Only allow a small portion of Decl's to be processed.  Remove this once
// all Decl's can be handled.
bool ODRHash::isSubDeclToBeProcessed(const Decl *D, const DeclContext *Parent) {}

void ODRHash::AddSubDecl(const Decl *D) {}

void ODRHash::AddCXXRecordDecl(const CXXRecordDecl *Record) {}

void ODRHash::AddRecordDecl(const RecordDecl *Record) {}

void ODRHash::AddObjCInterfaceDecl(const ObjCInterfaceDecl *IF) {}

void ODRHash::AddFunctionDecl(const FunctionDecl *Function,
                              bool SkipBody) {}

void ODRHash::AddEnumDecl(const EnumDecl *Enum) {}

void ODRHash::AddObjCProtocolDecl(const ObjCProtocolDecl *P) {}

void ODRHash::AddDecl(const Decl *D) {}

namespace {
// Process a Type pointer.  Add* methods call back into ODRHash while Visit*
// methods process the relevant parts of the Type.
class ODRTypeVisitor : public TypeVisitor<ODRTypeVisitor> {};
} // namespace

void ODRHash::AddType(const Type *T) {}

void ODRHash::AddQualType(QualType T) {}

void ODRHash::AddBoolean(bool Value) {}

void ODRHash::AddStructuralValue(const APValue &Value) {}