From 6447c475411adf29250a8ce903ffc3335da40d0b Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Sat, 30 Mar 2013 03:06:45 +0000 Subject: [PATCH] Elide all artificial copy constructors, because they are probably trivial. This means that we don't confuse Clang about whether a class is trivially copy constructible. It can figure that out itself as long as we don't explicitly feed it the constructors. If the class is trivially copy-constructible, this can change the ABI that Clang uses to call functions that return that class (e.g., by making the object be returned in a register), so this is quite important for correctness. llvm-svn: 178411 --- lldb/source/Symbol/ClangASTContext.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index ed8d98d..8d791de 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -1777,6 +1777,9 @@ ClangASTContext::AddMethodToCXXRecordType } else if (decl_name == cxx_record_decl->getDeclName()) { + if (is_artificial && method_function_prototype->getNumArgs() == 1) + return NULL; // skip artificial copy constructors + cxx_ctor_decl = CXXConstructorDecl::Create (*ast, cxx_record_decl, SourceLocation(), -- 2.7.4