summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCXXABI.h
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-06-19 15:20:38 +0000
committerReid Kleckner <reid@kleckner.net>2013-06-19 15:20:38 +0000
commit7810af0a43fc6b46eaed5c5c366adc0d3dda98c5 (patch)
treececb37431c2a64630c88bcda6b514966a28be80e /clang/lib/CodeGen/CGCXXABI.h
parent3793d5ed30613b97bf7735c21d84d440cbb00133 (diff)
downloadbcm5719-llvm-7810af0a43fc6b46eaed5c5c366adc0d3dda98c5.tar.gz
bcm5719-llvm-7810af0a43fc6b46eaed5c5c366adc0d3dda98c5.zip
[ms-cxxabi] Emit and install appropriately mangled vbtables
In Itanium, dynamic classes have one vtable with several different address points for dynamic base classes that can't share vtables. In the MS C++ ABI, each vbtable that can't be shared gets its own symbol, similar to how ctor vtables work in Itanium. However, instead of mangling the subobject offset into the symbol, the unique portions of the inheritance path are mangled into the symbol to make it unique. This patch implements the MSVC 2012 scheme for forming unique vbtable symbol names. MSVC 2010 use the same mangling with a different subset of the path. Implementing that mangling and possibly others is TODO. Each vbtable is an array of i32 offsets from the vbptr that points to it to another virtual base subobject. The first entry of a vbtable always points to the base of the current subobject, implying that it is the same no matter which parent class contains it. Reviewers: rjmccall Differential Revision: http://llvm-reviews.chandlerc.com/D636 llvm-svn: 184309
Diffstat (limited to 'clang/lib/CodeGen/CGCXXABI.h')
-rw-r--r--clang/lib/CodeGen/CGCXXABI.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCXXABI.h b/clang/lib/CodeGen/CGCXXABI.h
index 899e5e7b258..2e505d224fc 100644
--- a/clang/lib/CodeGen/CGCXXABI.h
+++ b/clang/lib/CodeGen/CGCXXABI.h
@@ -231,7 +231,8 @@ public:
CanQualType &ResTy,
SmallVectorImpl<CanQualType> &ArgTys) = 0;
- virtual llvm::BasicBlock *EmitCtorCompleteObjectHandler(CodeGenFunction &CGF);
+ virtual llvm::BasicBlock *EmitCtorCompleteObjectHandler(CodeGenFunction &CGF,
+ const CXXRecordDecl *RD);
/// Build the signature of the given destructor variant by adding
/// any required parameters. For convenience, ArgTys has been initialized
@@ -275,6 +276,13 @@ public:
ReturnValueSlot ReturnValue,
llvm::Value *This) = 0;
+ /// Emit any tables needed to implement virtual inheritance. For Itanium,
+ /// this emits virtual table tables. For the MSVC++ ABI, this emits virtual
+ /// base tables.
+ virtual void
+ EmitVirtualInheritanceTables(llvm::GlobalVariable::LinkageTypes Linkage,
+ const CXXRecordDecl *RD) = 0;
+
virtual void EmitReturnFromThunk(CodeGenFunction &CGF,
RValue RV, QualType ResultType);
OpenPOWER on IntegriCloud