summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGVTT.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-12-13 20:50:44 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-12-13 20:50:44 +0000
commit25a2b70cd0424ba3e344a70fea8dfa13a73829c2 (patch)
treecbfad442e24b31050c6e4066ee4e41641528ec2c /clang/lib/CodeGen/CGVTT.cpp
parent2849c4e841ccd421b8b0ba7486cfc66db9a47632 (diff)
downloadbcm5719-llvm-25a2b70cd0424ba3e344a70fea8dfa13a73829c2.tar.gz
bcm5719-llvm-25a2b70cd0424ba3e344a70fea8dfa13a73829c2.zip
CodeGen: Start using inrange annotations on vtable getelementptr.
This annotation allows the optimizer to split vtable groups, as permitted by a change to the Itanium ABI [1] that prevents compilers from adjusting virtual table pointers between virtual tables. [1] https://github.com/MentorEmbedded/cxx-abi/pull/7 Differential Revision: https://reviews.llvm.org/D24431 llvm-svn: 289585
Diffstat (limited to 'clang/lib/CodeGen/CGVTT.cpp')
-rw-r--r--clang/lib/CodeGen/CGVTT.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGVTT.cpp b/clang/lib/CodeGen/CGVTT.cpp
index 352d101d99b..92fd93b5ca3 100644
--- a/clang/lib/CodeGen/CGVTT.cpp
+++ b/clang/lib/CodeGen/CGVTT.cpp
@@ -80,8 +80,9 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT,
llvm::ConstantInt::get(Int32Ty, AddressPoint.AddressPointIndex),
};
- llvm::Constant *Init = llvm::ConstantExpr::getInBoundsGetElementPtr(
- VTable->getValueType(), VTable, Idxs);
+ llvm::Constant *Init = llvm::ConstantExpr::getGetElementPtr(
+ VTable->getValueType(), VTable, Idxs, /*InBounds=*/true,
+ /*InRangeIndex=*/1);
Init = llvm::ConstantExpr::getBitCast(Init, Int8PtrTy);
OpenPOWER on IntegriCloud