[llvm] r175423 - DIBuilder: Add function and method definitions to the list of all subprograms

David Blaikie dblaikie at gmail.com
Sun Feb 17 23:10:22 PST 2013


Author: dblaikie
Date: Mon Feb 18 01:10:22 2013
New Revision: 175423

URL: http://llvm.org/viewvc/llvm-project?rev=175423&view=rev
Log:
DIBuilder: Add function and method definitions to the list of all subprograms

Previously we seemed to be assuming that all functions were definitions and all
methods were declarations. This may be consistent with how Clang uses DIBuilder
but doesn't have to be true of all clients (such as DragonEgg).

Modified:
    llvm/trunk/lib/IR/DIBuilder.cpp

Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=175423&r1=175422&r2=175423&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Mon Feb 18 01:10:22 2013
@@ -924,7 +924,8 @@ DISubprogram DIBuilder::createFunction(D
   MDNode *Node = MDNode::get(VMContext, Elts);
 
   // Create a named metadata so that we do not lose this mdnode.
-  AllSubprograms.push_back(Node);
+  if (isDefinition)
+    AllSubprograms.push_back(Node);
   return DISubprogram(Node);
 }
 
@@ -968,6 +969,8 @@ DISubprogram DIBuilder::createMethod(DID
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNo)
   };
   MDNode *Node = MDNode::get(VMContext, Elts);
+  if (isDefinition)
+    AllSubprograms.push_back(Node);
   return DISubprogram(Node);
 }
 





More information about the llvm-commits mailing list