diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-03-14 19:07:10 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-03-14 19:07:10 +0000 |
commit | 4e6a54002403fcbfb04ef15c01c2d73c2870f09f (patch) | |
tree | 998420548162acef5fc4fb6d5230a742ce758166 /clang/lib/CodeGen/CGVTT.cpp | |
parent | 3e271af415abaed8d988990dd49b55eb6a95c81b (diff) | |
download | bcm5719-llvm-4e6a54002403fcbfb04ef15c01c2d73c2870f09f.tar.gz bcm5719-llvm-4e6a54002403fcbfb04ef15c01c2d73c2870f09f.zip |
CodeGen: Use 32-bit gep offsets to address vtable address points.
The relative vtable ABI will use a struct rather than an array as the type
of a vtable. LLVM only allows 32-bit integers as struct indices, so we need
to use 32-bit integers to get addresses of address points. In order to keep
the code simple, we might as well do that unconditionally.
It's probably a reasonable implementation limit to support no more than 2
billion virtual functions per class.
This change causes quite a bit of churn in the test suite, so I'm making
it separately.
Differential Revision: http://reviews.llvm.org/D18113
llvm-svn: 263469
Diffstat (limited to 'clang/lib/CodeGen/CGVTT.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGVTT.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGVTT.cpp b/clang/lib/CodeGen/CGVTT.cpp index 4fb76710d2a..3bf6a7f250c 100644 --- a/clang/lib/CodeGen/CGVTT.cpp +++ b/clang/lib/CodeGen/CGVTT.cpp @@ -44,7 +44,7 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT, const CXXRecordDecl *RD) { VTTBuilder Builder(CGM.getContext(), RD, /*GenerateDefinition=*/true); - llvm::Type *Int8PtrTy = CGM.Int8PtrTy, *Int64Ty = CGM.Int64Ty; + llvm::Type *Int8PtrTy = CGM.Int8PtrTy, *Int32Ty = CGM.Int32Ty; llvm::ArrayType *ArrayType = llvm::ArrayType::get(Int8PtrTy, Builder.getVTTComponents().size()); @@ -75,8 +75,8 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT, } llvm::Value *Idxs[] = { - llvm::ConstantInt::get(Int64Ty, 0), - llvm::ConstantInt::get(Int64Ty, AddressPoint) + llvm::ConstantInt::get(Int32Ty, 0), + llvm::ConstantInt::get(Int32Ty, AddressPoint) }; llvm::Constant *Init = llvm::ConstantExpr::getInBoundsGetElementPtr( |