[cfe-commits] r130561 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Devang Patel dpatel at apple.com
Fri Apr 29 16:42:32 PDT 2011


Author: dpatel
Date: Fri Apr 29 18:42:32 2011
New Revision: 130561

URL: http://llvm.org/viewvc/llvm-project?rev=130561&view=rev
Log:
Tie constructor defintion with its declaration using AT_specification.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=130561&r1=130560&r2=130561&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 29 18:42:32 2011
@@ -772,10 +772,7 @@
                           Virtuality, VIndex, ContainingType,
                           Flags, CGM.getLangOptions().Optimize);
   
-  // Don't cache ctors or dtors since we have to emit multiple functions for
-  // a single ctor or dtor.
-  if (!IsCtorOrDtor)
-    SPCache[Method] = llvm::WeakVH(SP);
+  SPCache[Method] = llvm::WeakVH(SP);
 
   return SP;
 }
@@ -1592,6 +1589,14 @@
   // Setup context.
   getContextDescriptor(cast<Decl>(D->getDeclContext()));
 
+  llvm::DenseMap<const FunctionDecl *, llvm::WeakVH>::iterator
+    MI = SPCache.find(FD);
+  if (MI != SPCache.end()) {
+    llvm::DISubprogram SP(dyn_cast_or_null<llvm::MDNode>(&*MI->second));
+    if (SP.isSubprogram() && !llvm::DISubprogram(SP).isDefinition())
+      return SP;
+  }
+
   for (FunctionDecl::redecl_iterator I = FD->redecls_begin(),
          E = FD->redecls_end(); I != E; ++I) {
     const FunctionDecl *NextFD = *I;





More information about the cfe-commits mailing list