Move info vectors and add assertions in preparation of moving the vector directly into RTTIBuilder.

llvm-svn: 91129
This commit is contained in:
Anders Carlsson 2009-12-11 16:41:51 +00:00
parent a0b98f083a
commit 1d6ad50826
1 changed files with 11 additions and 7 deletions

View File

@ -24,7 +24,8 @@ class RTTIBuilder {
const llvm::Type *Int8PtrTy;
llvm::SmallSet<const CXXRecordDecl *, 16> SeenVBase;
llvm::SmallSet<const CXXRecordDecl *, 32> 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<llvm::Constant *> 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<llvm::Constant *> 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<llvm::Constant *> 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<llvm::Constant *> info;
bool Extern = DecideExtern(Ty);
bool Hidden = DecideHidden(Ty);
@ -374,6 +377,9 @@ public:
}
llvm::Constant *BuildSimpleType(QualType Ty, const char *vtbl) {
std::vector<llvm::Constant *> 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<llvm::Constant *> info;
bool Extern = DecideExtern(Ty);
bool Hidden = DecideHidden(Ty);