summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/MicrosoftCXXABI.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-09-25 10:10:39 +0000
committerJohn McCall <rjmccall@apple.com>2012-09-25 10:10:39 +0000
commit82fb892019bd1784153587a69d5bdfc72736d0ee (patch)
treec4f9f3b9512d8f2b045d115e43066a5985c499e2 /clang/lib/CodeGen/MicrosoftCXXABI.cpp
parent8b907e8acbacc4485b0c5cc4777d5d5844ece52d (diff)
downloadbcm5719-llvm-82fb892019bd1784153587a69d5bdfc72736d0ee.tar.gz
bcm5719-llvm-82fb892019bd1784153587a69d5bdfc72736d0ee.zip
When performing a ::delete of an object with a virtual destructor,
be sure to delete the complete object pointer, not the original pointer. This is necessary if the base being deleted is at a non-zero offset in the complete object. This is only required for objects with virtual destructors because deleting an object via a base-class subobject when the base does not have a virtual destructor is undefined behavior. Noticed while reviewing the last four years of cxx-abi-dev activity. llvm-svn: 164597
Diffstat (limited to 'clang/lib/CodeGen/MicrosoftCXXABI.cpp')
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index b000c68a952..2c8173ba384 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -30,6 +30,10 @@ public:
StringRef GetPureVirtualCallName() { return "_purecall"; }
+ llvm::Value *adjustToCompleteObject(CodeGenFunction &CGF,
+ llvm::Value *ptr,
+ QualType type);
+
void BuildConstructorSignature(const CXXConstructorDecl *Ctor,
CXXCtorType Type,
CanQualType &ResTy,
@@ -95,6 +99,13 @@ public:
}
+llvm::Value *MicrosoftCXXABI::adjustToCompleteObject(CodeGenFunction &CGF,
+ llvm::Value *ptr,
+ QualType type) {
+ // FIXME: implement
+ return ptr;
+}
+
bool MicrosoftCXXABI::needThisReturn(GlobalDecl GD) {
const CXXMethodDecl* MD = cast<CXXMethodDecl>(GD.getDecl());
return isa<CXXConstructorDecl>(MD);
OpenPOWER on IntegriCloud