aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-12 00:00:29 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-12 00:00:29 +0000
commitc7cba15f5fd86b96c03c57a1d307dde468f7399b (patch)
treea2fb6cef0b91a9c3bbc5846aeb059ee82891d825 /lib/CodeGen/CGCXX.cpp
parent6e319f6adc2a06c31cf99265854eef1321bcecf2 (diff)
Fix a crash when generating vtables that contain destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81587 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r--lib/CodeGen/CGCXX.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 742077f3ff..7def3c7834 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -993,20 +993,19 @@ public:
++mi)
if (mi->isVirtual()) {
const CXXMethodDecl *MD = *mi;
- llvm::Constant *m = wrap(CGM.GetAddrOfFunction(MD, Ptr8Ty));
+ llvm::Constant *m = wrap(CGM.GetAddrOfFunction(MD));
OverrideMethod(MD, m, MorallyVirtual, Offset);
}
}
}
void AddMethod(const CXXMethodDecl *MD, bool MorallyVirtual, Index_t Offset) {
- GlobalDecl GD;
+ llvm::Constant *m = 0;
if (const CXXDestructorDecl *Dtor = dyn_cast<CXXDestructorDecl>(MD))
- GD = GlobalDecl(Dtor, Dtor_Complete);
+ m = wrap(CGM.GetAddrOfCXXDestructor(Dtor, Dtor_Complete));
else
- GD = GlobalDecl(MD);
+ m = wrap(CGM.GetAddrOfFunction(MD));
- llvm::Constant *m = wrap(CGM.GetAddrOfFunction(GD, Ptr8Ty));
// If we can find a previously allocated slot for this, reuse it.
if (OverrideMethod(MD, m, MorallyVirtual, Offset))
return;