From: Anders Carlsson Date: Fri, 11 Dec 2009 16:41:51 +0000 (+0000) Subject: Move info vectors and add assertions in preparation of moving the vector directly... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44636d11eab74ea3948393f889173766096916ae;p=clang Move info vectors and add assertions in preparation of moving the vector directly into RTTIBuilder. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91129 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index 24b3efff6d..a574703935 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -24,7 +24,8 @@ class RTTIBuilder { const llvm::Type *Int8PtrTy; llvm::SmallSet SeenVBase; llvm::SmallSet SeenBase; - + + // Type info flags. enum { /// TI_Const - Type has const qualifier. @@ -213,6 +214,9 @@ public: llvm::Constant * Buildclass_type_info(const CXXRecordDecl *RD, llvm::GlobalVariable::LinkageTypes Linkage) { + std::vector info; + assert(info.empty() && "Info vector must be empty!"); + llvm::Constant *C; llvm::SmallString<256> OutName; @@ -225,8 +229,6 @@ public: if (GV && !GV->isDeclaration()) return llvm::ConstantExpr::getBitCast(GV, Int8PtrTy); - std::vector info; - // If we're in an anonymous namespace, then we always want internal linkage. if (RD->isInAnonymousNamespace()) Linkage = llvm::GlobalVariable::InternalLinkage; @@ -311,6 +313,9 @@ public: } llvm::Constant *BuildPointerType(QualType Ty) { + std::vector info; + assert(info.empty() && "Info vector must be empty!"); + llvm::Constant *C; llvm::SmallString<256> OutName; @@ -322,8 +327,6 @@ public: if (GV && !GV->isDeclaration()) return llvm::ConstantExpr::getBitCast(GV, Int8PtrTy); - std::vector info; - bool Extern = DecideExtern(Ty); bool Hidden = DecideHidden(Ty); @@ -374,6 +377,9 @@ public: } llvm::Constant *BuildSimpleType(QualType Ty, const char *vtbl) { + std::vector info; + assert(info.empty() && "Info vector must be empty!"); + llvm::Constant *C; llvm::SmallString<256> OutName; @@ -385,8 +391,6 @@ public: if (GV && !GV->isDeclaration()) return llvm::ConstantExpr::getBitCast(GV, Int8PtrTy); - std::vector info; - bool Extern = DecideExtern(Ty); bool Hidden = DecideHidden(Ty);