summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-09-03 00:01:57 +0000
committerJohn McCall <rjmccall@apple.com>2010-09-03 00:01:57 +0000
commit12d3891a27925e874c6a023d12faf6f39ffdb173 (patch)
tree08873052106c8cd346dacf286a38ed6b688feafc /clang/lib/CodeGen/CGCall.cpp
parent68bb1b441fc7e80eb1ffbfc7fa83d6878fec64ca (diff)
downloadbcm5719-llvm-12d3891a27925e874c6a023d12faf6f39ffdb173.tar.gz
bcm5719-llvm-12d3891a27925e874c6a023d12faf6f39ffdb173.zip
It's not safe to use the generic CXXMethodDecl overload of CGT::getFunctionInfo
to set up a destructor call, because ABIs can tweak these conventions. Fixes rdar://problem/8386802. llvm-svn: 112916
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 6072c1c499d..f698d146f1b 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -117,6 +117,9 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXRecordDecl *RD,
const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXMethodDecl *MD) {
llvm::SmallVector<CanQualType, 16> ArgTys;
+ assert(!isa<CXXConstructorDecl>(MD) && "wrong method for contructors!");
+ assert(!isa<CXXDestructorDecl>(MD) && "wrong method for destructors!");
+
// Add the 'this' pointer unless this is a static method.
if (MD->isInstance())
ArgTys.push_back(GetThisType(Context, MD->getParent()));
OpenPOWER on IntegriCloud