From 12d3891a27925e874c6a023d12faf6f39ffdb173 Mon Sep 17 00:00:00 2001 From: John McCall Date: Fri, 3 Sep 2010 00:01:57 +0000 Subject: 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 --- clang/lib/CodeGen/CGCall.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/CodeGen/CGCall.cpp') 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 ArgTys; + assert(!isa(MD) && "wrong method for contructors!"); + assert(!isa(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())); -- cgit v1.2.3