aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-06-17 19:08:05 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-06-17 19:08:05 +0000
commit86d34a72b3c1abcbeb38fa6670f83cd733de1234 (patch)
treee73836c747aa5f9c6f3e258bb25d461317b02a37 /clang/lib/CodeGen/CodeGenModule.cpp
parent3d920eed5d1908fb62b58124369493dfd3a2b42c (diff)
downloadllvm-86d34a72b3c1abcbeb38fa6670f83cd733de1234.zip
llvm-86d34a72b3c1abcbeb38fa6670f83cd733de1234.tar.gz
llvm-86d34a72b3c1abcbeb38fa6670f83cd733de1234.tar.bz2
CodeGen: Factor out some of the bitset entry creation code. NFC.
llvm-svn: 239927
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index af4e6d9..c0cbe98 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3659,3 +3659,17 @@ void CodeGenModule::EmitOMPThreadPrivateDecl(const OMPThreadPrivateDecl *D) {
CXXGlobalInits.push_back(InitFunction);
}
}
+
+llvm::MDTuple *CodeGenModule::CreateVTableBitSetEntry(
+ llvm::GlobalVariable *VTable, CharUnits Offset, const CXXRecordDecl *RD) {
+ std::string OutName;
+ llvm::raw_string_ostream Out(OutName);
+ getCXXABI().getMangleContext().mangleCXXVTableBitSet(RD, Out);
+
+ llvm::Metadata *BitsetOps[] = {
+ llvm::MDString::get(getLLVMContext(), Out.str()),
+ llvm::ConstantAsMetadata::get(VTable),
+ llvm::ConstantAsMetadata::get(
+ llvm::ConstantInt::get(Int64Ty, Offset.getQuantity()))};
+ return llvm::MDTuple::get(getLLVMContext(), BitsetOps);
+}