diff options
author | Anders Carlsson <andersca@mac.com> | 2010-05-05 05:47:36 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-05-05 05:47:36 +0000 |
commit | 68e3013ade8a219625b636bb8c1dcec2ba6fb685 (patch) | |
tree | 37fc9c9717c9ed61e9e72f57549c62fffe7acb5e /lib/CodeGen/CGRecordLayoutBuilder.cpp | |
parent | 71b1d0e5f07de274af2b3c48955af66b1b7f0403 (diff) |
Use a more appropriate LLVM type for the vtable pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRecordLayoutBuilder.cpp')
-rw-r--r-- | lib/CodeGen/CGRecordLayoutBuilder.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/CodeGen/CGRecordLayoutBuilder.cpp b/lib/CodeGen/CGRecordLayoutBuilder.cpp index 6302cf8d1f..0966678f3e 100644 --- a/lib/CodeGen/CGRecordLayoutBuilder.cpp +++ b/lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -439,12 +439,14 @@ void CGRecordLayoutBuilder::LayoutBases(const CXXRecordDecl *RD, const ASTRecordLayout &Layout) { // Check if we need to add a vtable pointer. if (RD->isDynamicClass() && !Layout.getPrimaryBase()) { - const llvm::Type *Int8PtrTy = - llvm::Type::getInt8PtrTy(Types.getLLVMContext()); + const llvm::Type *FunctionType = + llvm::FunctionType::get(llvm::Type::getInt32Ty(Types.getLLVMContext()), + /*isVarArg=*/true); + const llvm::Type *VTableTy = FunctionType->getPointerTo(); assert(NextFieldOffsetInBytes == 0 && "VTable pointer must come first!"); - AppendField(NextFieldOffsetInBytes, Int8PtrTy->getPointerTo()); + AppendField(NextFieldOffsetInBytes, VTableTy->getPointerTo()); } } |