[Lldb-commits] [lldb] r178411 - Elide all artificial copy constructors, because

Sean Callanan scallanan at apple.com
Fri Mar 29 20:06:46 PDT 2013


Author: spyffe
Date: Fri Mar 29 22:06:45 2013
New Revision: 178411

URL: http://llvm.org/viewvc/llvm-project?rev=178411&view=rev
Log:
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.

<rdar://problem/13457741>

Modified:
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=178411&r1=178410&r2=178411&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Mar 29 22:06:45 2013
@@ -1777,6 +1777,9 @@ ClangASTContext::AddMethodToCXXRecordTyp
     }
     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(),





More information about the lldb-commits mailing list