summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-05 21:09:05 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-05 21:09:05 +0000
commita95d4c51dcfa404423862dfe292f96ec0a6fbc2b (patch)
tree8a1a24ccfb2e447a6239a0ec1c5614ad65e92399 /clang/lib
parentc8e39ec79f462d343c739135a128e749e510d87e (diff)
downloadbcm5719-llvm-a95d4c51dcfa404423862dfe292f96ec0a6fbc2b.tar.gz
bcm5719-llvm-a95d4c51dcfa404423862dfe292f96ec0a6fbc2b.zip
Make sure that hte vtable always has an i8* array type.
llvm-svn: 90675
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGVtable.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp
index 2fca7a75f9a..8bf940b40c2 100644
--- a/clang/lib/CodeGen/CGVtable.cpp
+++ b/clang/lib/CodeGen/CGVtable.cpp
@@ -1130,21 +1130,20 @@ llvm::Constant *CodeGenModule::GenerateVtable(const CXXRecordDecl *LayoutClass,
b.GenerateVtableForVBases(RD, Offset);
llvm::Constant *C = 0;
- llvm::Type *type = Ptr8Ty;
+ llvm::ArrayType *ntype =
+ llvm::ArrayType::get(Ptr8Ty, b.getVtable().size());
+
llvm::GlobalVariable::LinkageTypes linktype
= llvm::GlobalValue::ExternalLinkage;
if (CreateDefinition) {
- llvm::ArrayType *ntype =
- llvm::ArrayType::get(Ptr8Ty, b.getVtable().size());
C = llvm::ConstantArray::get(ntype, &b.getVtable()[0],
b.getVtable().size());
linktype = llvm::GlobalValue::LinkOnceODRLinkage;
if (LayoutClass->isInAnonymousNamespace())
linktype = llvm::GlobalValue::InternalLinkage;
- type = ntype;
}
llvm::GlobalVariable *OGV = GV;
- GV = new llvm::GlobalVariable(getModule(), type, true, linktype, C, Name);
+ GV = new llvm::GlobalVariable(getModule(), ntype, true, linktype, C, Name);
if (OGV) {
GV->takeName(OGV);
llvm::Constant *NewPtr = llvm::ConstantExpr::getBitCast(GV,
OpenPOWER on IntegriCloud