return;
llvm::Constant *Vtable = CGM.getVtableInfo().getVtable(ClassDecl);
- CodeGenModule::AddrSubMap_t& AddressPoints =
- *(*CGM.AddressPoints[ClassDecl])[ClassDecl];
+ CGVtableInfo::AddrSubMap_t& AddressPoints =
+ *(*CGM.getVtableInfo().AddressPoints[ClassDecl])[ClassDecl];
llvm::Value *ThisPtr = LoadCXXThis();
const ASTRecordLayout &Layout = getContext().getASTRecordLayout(ClassDecl);
void CodeGenFunction::InitializeVtablePtrsRecursive(
const CXXRecordDecl *ClassDecl,
llvm::Constant *Vtable,
- CodeGenModule::AddrSubMap_t& AddressPoints,
+ CGVtableInfo::AddrSubMap_t& AddressPoints,
llvm::Value *ThisPtr,
uint64_t Offset) {
if (!ClassDecl->isDynamicClass())
static llvm::DenseMap<CtorVtable_t, int64_t>&
AllocAddressPoint(CodeGenModule &cgm, const CXXRecordDecl *l,
const CXXRecordDecl *c) {
- CodeGenModule::AddrMap_t *&oref = cgm.AddressPoints[l];
+ CGVtableInfo::AddrMap_t *&oref = cgm.getVtableInfo().AddressPoints[l];
if (oref == 0)
- oref = new CodeGenModule::AddrMap_t;
+ oref = new CGVtableInfo::AddrMap_t;
llvm::DenseMap<CtorVtable_t, int64_t> *&ref = (*oref)[c];
if (ref == 0)
uint64_t CGVtableInfo::getVtableAddressPoint(const CXXRecordDecl *RD) {
uint64_t AddressPoint =
- (*(*(CGM.AddressPoints[RD]))[RD])[std::make_pair(RD, 0)];
+ (*(*(CGM.getVtableInfo().AddressPoints[RD]))[RD])[std::make_pair(RD, 0)];
return AddressPoint;
}
llvm::StringRef Name = OutName.str();
llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
- if (GV == 0 || CGM.AddressPoints[LayoutClass] == 0 || GV->isDeclaration()) {
+ if (GV == 0 || CGM.getVtableInfo().AddressPoints[LayoutClass] == 0 ||
+ GV->isDeclaration()) {
VtableBuilder b(RD, LayoutClass, Offset, CGM, GenerateDefinition);
D1(printf("vtable %s\n", RD->getNameAsCString()));
/// BLayout - Layout for the most derived class that this vtable is being
/// built for.
const ASTRecordLayout &BLayout;
- CodeGenModule::AddrMap_t &AddressPoints;
+ CGVtableInfo::AddrMap_t &AddressPoints;
// vtbl - A pointer to the vtable for Class.
llvm::Constant *ClassVtbl;
llvm::LLVMContext &VMContext;
CodeGenModule &cgm, bool GenerateDefinition)
: Inits(inits), Class(c), CGM(cgm),
BLayout(cgm.getContext().getASTRecordLayout(c)),
- AddressPoints(*cgm.AddressPoints[c]),
+ AddressPoints(*cgm.getVtableInfo().AddressPoints[c]),
VMContext(cgm.getModule().getContext()),
GenerateDefinition(GenerateDefinition) {
typedef std::vector<std::pair<GlobalDecl, ThunkAdjustment> >
AdjustmentVectorTy;
+ typedef std::pair<const CXXRecordDecl *, uint64_t> CtorVtable_t;
+ typedef llvm::DenseMap<CtorVtable_t, int64_t> AddrSubMap_t;
+ typedef llvm::DenseMap<const CXXRecordDecl *, AddrSubMap_t *> AddrMap_t;
+ llvm::DenseMap<const CXXRecordDecl *, AddrMap_t*> AddressPoints;
+
private:
CodeGenModule &CGM;
BuildCovariantThunk(const GlobalDecl &GD, bool Extern,
const CovariantThunkAdjustment &Adjustment);
- typedef std::pair<const CXXRecordDecl *, uint64_t> CtorVtable_t;
- typedef llvm::DenseMap<CtorVtable_t, int64_t> AddrSubMap_t;
- typedef llvm::DenseMap<const CXXRecordDecl *, AddrSubMap_t *> AddrMap_t;
- llvm::DenseMap<const CXXRecordDecl *, AddrMap_t*> AddressPoints;
-
/// GetCXXBaseClassOffset - Returns the offset from a derived class to its
/// base class. Returns null if the offset is 0.
llvm::Constant *GetCXXBaseClassOffset(const CXXRecordDecl *ClassDecl,