#include "ASTCommon.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/Expr.h"
#include "clang/AST/OpenMPClause.h"
#include "clang/AST/PrettyDeclStackTrace.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Serialization/ASTReader.h"
#include "clang/Serialization/ASTRecordWriter.h"
#include "llvm/Bitstream/BitstreamWriter.h"
#include "llvm/Support/ErrorHandling.h"
#include <optional>
usingnamespaceclang;
usingnamespaceserialization;
namespace clang {
class ASTDeclWriter : public DeclVisitor<ASTDeclWriter, void> { … };
}
bool clang::CanElideDeclDef(const Decl *D) { … }
void ASTDeclWriter::Visit(Decl *D) { … }
void ASTDeclWriter::VisitDecl(Decl *D) { … }
void ASTDeclWriter::VisitPragmaCommentDecl(PragmaCommentDecl *D) { … }
void ASTDeclWriter::VisitPragmaDetectMismatchDecl(
PragmaDetectMismatchDecl *D) { … }
void ASTDeclWriter::VisitTranslationUnitDecl(TranslationUnitDecl *D) { … }
void ASTDeclWriter::VisitNamedDecl(NamedDecl *D) { … }
void ASTDeclWriter::VisitTypeDecl(TypeDecl *D) { … }
void ASTDeclWriter::VisitTypedefNameDecl(TypedefNameDecl *D) { … }
void ASTDeclWriter::VisitTypedefDecl(TypedefDecl *D) { … }
void ASTDeclWriter::VisitTypeAliasDecl(TypeAliasDecl *D) { … }
void ASTDeclWriter::VisitTagDecl(TagDecl *D) { … }
void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) { … }
void ASTDeclWriter::VisitRecordDecl(RecordDecl *D) { … }
void ASTDeclWriter::VisitValueDecl(ValueDecl *D) { … }
void ASTDeclWriter::VisitEnumConstantDecl(EnumConstantDecl *D) { … }
void ASTDeclWriter::VisitDeclaratorDecl(DeclaratorDecl *D) { … }
void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { … }
static void addExplicitSpecifier(ExplicitSpecifier ES,
ASTRecordWriter &Record) { … }
void ASTDeclWriter::VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D) { … }
void ASTDeclWriter::VisitObjCMethodDecl(ObjCMethodDecl *D) { … }
void ASTDeclWriter::VisitObjCTypeParamDecl(ObjCTypeParamDecl *D) { … }
void ASTDeclWriter::VisitObjCContainerDecl(ObjCContainerDecl *D) { … }
void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { … }
void ASTDeclWriter::VisitObjCIvarDecl(ObjCIvarDecl *D) { … }
void ASTDeclWriter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { … }
void ASTDeclWriter::VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D) { … }
void ASTDeclWriter::VisitObjCCategoryDecl(ObjCCategoryDecl *D) { … }
void ASTDeclWriter::VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D) { … }
void ASTDeclWriter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { … }
void ASTDeclWriter::VisitObjCImplDecl(ObjCImplDecl *D) { … }
void ASTDeclWriter::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) { … }
void ASTDeclWriter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) { … }
void ASTDeclWriter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) { … }
void ASTDeclWriter::VisitFieldDecl(FieldDecl *D) { … }
void ASTDeclWriter::VisitMSPropertyDecl(MSPropertyDecl *D) { … }
void ASTDeclWriter::VisitMSGuidDecl(MSGuidDecl *D) { … }
void ASTDeclWriter::VisitUnnamedGlobalConstantDecl(
UnnamedGlobalConstantDecl *D) { … }
void ASTDeclWriter::VisitTemplateParamObjectDecl(TemplateParamObjectDecl *D) { … }
void ASTDeclWriter::VisitIndirectFieldDecl(IndirectFieldDecl *D) { … }
void ASTDeclWriter::VisitVarDecl(VarDecl *D) { … }
void ASTDeclWriter::VisitImplicitParamDecl(ImplicitParamDecl *D) { … }
void ASTDeclWriter::VisitParmVarDecl(ParmVarDecl *D) { … }
void ASTDeclWriter::VisitDecompositionDecl(DecompositionDecl *D) { … }
void ASTDeclWriter::VisitBindingDecl(BindingDecl *D) { … }
void ASTDeclWriter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) { … }
void ASTDeclWriter::VisitTopLevelStmtDecl(TopLevelStmtDecl *D) { … }
void ASTDeclWriter::VisitEmptyDecl(EmptyDecl *D) { … }
void ASTDeclWriter::VisitLifetimeExtendedTemporaryDecl(
LifetimeExtendedTemporaryDecl *D) { … }
void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) { … }
void ASTDeclWriter::VisitCapturedDecl(CapturedDecl *CD) { … }
void ASTDeclWriter::VisitLinkageSpecDecl(LinkageSpecDecl *D) { … }
void ASTDeclWriter::VisitExportDecl(ExportDecl *D) { … }
void ASTDeclWriter::VisitLabelDecl(LabelDecl *D) { … }
void ASTDeclWriter::VisitNamespaceDecl(NamespaceDecl *D) { … }
void ASTDeclWriter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { … }
void ASTDeclWriter::VisitUsingDecl(UsingDecl *D) { … }
void ASTDeclWriter::VisitUsingEnumDecl(UsingEnumDecl *D) { … }
void ASTDeclWriter::VisitUsingPackDecl(UsingPackDecl *D) { … }
void ASTDeclWriter::VisitUsingShadowDecl(UsingShadowDecl *D) { … }
void ASTDeclWriter::VisitConstructorUsingShadowDecl(
ConstructorUsingShadowDecl *D) { … }
void ASTDeclWriter::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { … }
void ASTDeclWriter::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) { … }
void ASTDeclWriter::VisitUnresolvedUsingTypenameDecl(
UnresolvedUsingTypenameDecl *D) { … }
void ASTDeclWriter::VisitUnresolvedUsingIfExistsDecl(
UnresolvedUsingIfExistsDecl *D) { … }
void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) { … }
void ASTDeclWriter::VisitCXXMethodDecl(CXXMethodDecl *D) { … }
void ASTDeclWriter::VisitCXXConstructorDecl(CXXConstructorDecl *D) { … }
void ASTDeclWriter::VisitCXXDestructorDecl(CXXDestructorDecl *D) { … }
void ASTDeclWriter::VisitCXXConversionDecl(CXXConversionDecl *D) { … }
void ASTDeclWriter::VisitImportDecl(ImportDecl *D) { … }
void ASTDeclWriter::VisitAccessSpecDecl(AccessSpecDecl *D) { … }
void ASTDeclWriter::VisitFriendDecl(FriendDecl *D) { … }
void ASTDeclWriter::VisitFriendTemplateDecl(FriendTemplateDecl *D) { … }
void ASTDeclWriter::VisitTemplateDecl(TemplateDecl *D) { … }
void ASTDeclWriter::VisitConceptDecl(ConceptDecl *D) { … }
void ASTDeclWriter::VisitImplicitConceptSpecializationDecl(
ImplicitConceptSpecializationDecl *D) { … }
void ASTDeclWriter::VisitRequiresExprBodyDecl(RequiresExprBodyDecl *D) { … }
void ASTDeclWriter::VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D) { … }
void ASTDeclWriter::VisitClassTemplateDecl(ClassTemplateDecl *D) { … }
void ASTDeclWriter::VisitClassTemplateSpecializationDecl(
ClassTemplateSpecializationDecl *D) { … }
void ASTDeclWriter::VisitClassTemplatePartialSpecializationDecl(
ClassTemplatePartialSpecializationDecl *D) { … }
void ASTDeclWriter::VisitVarTemplateDecl(VarTemplateDecl *D) { … }
void ASTDeclWriter::VisitVarTemplateSpecializationDecl(
VarTemplateSpecializationDecl *D) { … }
void ASTDeclWriter::VisitVarTemplatePartialSpecializationDecl(
VarTemplatePartialSpecializationDecl *D) { … }
void ASTDeclWriter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { … }
void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { … }
void ASTDeclWriter::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) { … }
void ASTDeclWriter::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) { … }
void ASTDeclWriter::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) { … }
void ASTDeclWriter::VisitStaticAssertDecl(StaticAssertDecl *D) { … }
void ASTDeclWriter::VisitDeclContext(DeclContext *DC) { … }
const Decl *ASTWriter::getFirstLocalDecl(const Decl *D) { … }
template <typename T>
void ASTDeclWriter::VisitRedeclarable(Redeclarable<T> *D) { … }
void ASTDeclWriter::VisitHLSLBufferDecl(HLSLBufferDecl *D) { … }
void ASTDeclWriter::VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D) { … }
void ASTDeclWriter::VisitOMPAllocateDecl(OMPAllocateDecl *D) { … }
void ASTDeclWriter::VisitOMPRequiresDecl(OMPRequiresDecl *D) { … }
void ASTDeclWriter::VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D) { … }
void ASTDeclWriter::VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D) { … }
void ASTDeclWriter::VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D) { … }
namespace {
template <FunctionDecl::TemplatedKind Kind>
std::shared_ptr<llvm::BitCodeAbbrev>
getFunctionDeclAbbrev(serialization::DeclCode Code) { … }
template <FunctionDecl::TemplatedKind Kind>
std::shared_ptr<llvm::BitCodeAbbrev> getCXXMethodAbbrev() { … }
}
void ASTWriter::WriteDeclAbbrevs() { … }
static bool isRequiredDecl(const Decl *D, ASTContext &Context,
Module *WritingModule) { … }
void ASTWriter::WriteDecl(ASTContext &Context, Decl *D) { … }
void ASTRecordWriter::AddFunctionDefinition(const FunctionDecl *FD) { … }