//===--- CGVtable.cpp - Emit LLVM Code for C++ vtables --------------------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This contains code dealing with C++ code generation of virtual tables.////===----------------------------------------------------------------------===//#include"CodeGenModule.h"#include"CodeGenFunction.h"#include"clang/AST/CXXInheritance.h"#include"clang/AST/RecordLayout.h"#include"llvm/ADT/DenseSet.h"#include<cstdio>usingnamespaceclang;usingnamespaceCodeGen;namespace{classVtableBuilder{public:/// Index_t - Vtable index type.typedefuint64_tIndex_t;private:// VtableComponents - The components of the vtable being built.typedefllvm::SmallVector<llvm::Constant*,64>VtableComponentsVectorTy;VtableComponentsVectorTyVtableComponents;constboolBuildVtable;llvm::Type*Ptr8Ty;/// MostDerivedClass - The most derived class that this vtable is being /// built for.constCXXRecordDecl*MostDerivedClass;/// LayoutClass - The most derived class used for virtual base layout/// information.constCXXRecordDecl*LayoutClass;/// LayoutOffset - The offset for Class in LayoutClass.uint64_tLayoutOffset;/// BLayout - Layout for the most derived class that this vtable is being/// built for.constASTRecordLayout&BLayout;llvm::SmallSet<const