diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 9fdff82539f3..2840ee6e714d 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -653,36 +653,36 @@ CollectCXXBases(const CXXRecordDecl *Decl, llvm::SmallVectorImpl &EltTys, llvm::DICompositeType &RecordTy) { - const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(Decl); - for (CXXRecordDecl::base_class_const_iterator BI = Decl->bases_begin(), - BE = Decl->bases_end(); BI != BE; ++BI) { - unsigned BFlags = 0; - uint64_t BaseOffset; - - const CXXRecordDecl *Base = - cast(BI->getType()->getAs()->getDecl()); - - if (BI->isVirtual()) { - BaseOffset = RL.getVBaseClassOffset(Base); - BFlags = llvm::DIType::FlagVirtual; - } else - BaseOffset = RL.getBaseClassOffset(Base); - - AccessSpecifier Access = BI->getAccessSpecifier(); - if (Access == clang::AS_private) - BFlags |= llvm::DIType::FlagPrivate; - else if (Access == clang::AS_protected) - BFlags |= llvm::DIType::FlagProtected; - - llvm::DIType DTy = - DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_inheritance, - RecordTy, llvm::StringRef(), - llvm::DICompileUnit(), 0, 0, 0, - BaseOffset, BFlags, - getOrCreateType(BI->getType(), - Unit)); - EltTys.push_back(DTy); - } + const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(Decl); + for (CXXRecordDecl::base_class_const_iterator BI = Decl->bases_begin(), + BE = Decl->bases_end(); BI != BE; ++BI) { + unsigned BFlags = 0; + uint64_t BaseOffset; + + const CXXRecordDecl *Base = + cast(BI->getType()->getAs()->getDecl()); + + if (BI->isVirtual()) { + BaseOffset = RL.getVBaseClassOffset(Base); + BFlags = llvm::DIType::FlagVirtual; + } else + BaseOffset = RL.getBaseClassOffset(Base); + + AccessSpecifier Access = BI->getAccessSpecifier(); + if (Access == clang::AS_private) + BFlags |= llvm::DIType::FlagPrivate; + else if (Access == clang::AS_protected) + BFlags |= llvm::DIType::FlagProtected; + + llvm::DIType DTy = + DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_inheritance, + RecordTy, llvm::StringRef(), + llvm::DICompileUnit(), 0, 0, 0, + BaseOffset, BFlags, + getOrCreateType(BI->getType(), + Unit)); + EltTys.push_back(DTy); + } } /// getOrCreateVTablePtrType - Return debug info descriptor for vtable.