forked from OSchip/llvm-project
parent
954cb187e0
commit
128aa9d176
|
@ -653,36 +653,36 @@ CollectCXXBases(const CXXRecordDecl *Decl,
|
||||||
llvm::SmallVectorImpl<llvm::DIDescriptor> &EltTys,
|
llvm::SmallVectorImpl<llvm::DIDescriptor> &EltTys,
|
||||||
llvm::DICompositeType &RecordTy) {
|
llvm::DICompositeType &RecordTy) {
|
||||||
|
|
||||||
const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(Decl);
|
const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(Decl);
|
||||||
for (CXXRecordDecl::base_class_const_iterator BI = Decl->bases_begin(),
|
for (CXXRecordDecl::base_class_const_iterator BI = Decl->bases_begin(),
|
||||||
BE = Decl->bases_end(); BI != BE; ++BI) {
|
BE = Decl->bases_end(); BI != BE; ++BI) {
|
||||||
unsigned BFlags = 0;
|
unsigned BFlags = 0;
|
||||||
uint64_t BaseOffset;
|
uint64_t BaseOffset;
|
||||||
|
|
||||||
const CXXRecordDecl *Base =
|
const CXXRecordDecl *Base =
|
||||||
cast<CXXRecordDecl>(BI->getType()->getAs<RecordType>()->getDecl());
|
cast<CXXRecordDecl>(BI->getType()->getAs<RecordType>()->getDecl());
|
||||||
|
|
||||||
if (BI->isVirtual()) {
|
if (BI->isVirtual()) {
|
||||||
BaseOffset = RL.getVBaseClassOffset(Base);
|
BaseOffset = RL.getVBaseClassOffset(Base);
|
||||||
BFlags = llvm::DIType::FlagVirtual;
|
BFlags = llvm::DIType::FlagVirtual;
|
||||||
} else
|
} else
|
||||||
BaseOffset = RL.getBaseClassOffset(Base);
|
BaseOffset = RL.getBaseClassOffset(Base);
|
||||||
|
|
||||||
AccessSpecifier Access = BI->getAccessSpecifier();
|
AccessSpecifier Access = BI->getAccessSpecifier();
|
||||||
if (Access == clang::AS_private)
|
if (Access == clang::AS_private)
|
||||||
BFlags |= llvm::DIType::FlagPrivate;
|
BFlags |= llvm::DIType::FlagPrivate;
|
||||||
else if (Access == clang::AS_protected)
|
else if (Access == clang::AS_protected)
|
||||||
BFlags |= llvm::DIType::FlagProtected;
|
BFlags |= llvm::DIType::FlagProtected;
|
||||||
|
|
||||||
llvm::DIType DTy =
|
llvm::DIType DTy =
|
||||||
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_inheritance,
|
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_inheritance,
|
||||||
RecordTy, llvm::StringRef(),
|
RecordTy, llvm::StringRef(),
|
||||||
llvm::DICompileUnit(), 0, 0, 0,
|
llvm::DICompileUnit(), 0, 0, 0,
|
||||||
BaseOffset, BFlags,
|
BaseOffset, BFlags,
|
||||||
getOrCreateType(BI->getType(),
|
getOrCreateType(BI->getType(),
|
||||||
Unit));
|
Unit));
|
||||||
EltTys.push_back(DTy);
|
EltTys.push_back(DTy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getOrCreateVTablePtrType - Return debug info descriptor for vtable.
|
/// getOrCreateVTablePtrType - Return debug info descriptor for vtable.
|
||||||
|
|
Loading…
Reference in New Issue