[llvm-commits] [llvm] r93802 - in /llvm/trunk: include/llvm/Metadata.h lib/VMCore/Metadata.cpp

Victor Hernandez vhernandez at apple.com
Mon Jan 18 14:55:08 PST 2010


Author: hernande
Date: Mon Jan 18 16:55:08 2010
New Revision: 93802

URL: http://llvm.org/viewvc/llvm-project?rev=93802&view=rev
Log:
Add comment that MDNode::getFunction() is not to be used by performance-critical code (currently only used by AsmWriter)

Modified:
    llvm/trunk/include/llvm/Metadata.h
    llvm/trunk/lib/VMCore/Metadata.cpp

Modified: llvm/trunk/include/llvm/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=93802&r1=93801&r2=93802&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Metadata.h (original)
+++ llvm/trunk/include/llvm/Metadata.h Mon Jan 18 16:55:08 2010
@@ -154,7 +154,8 @@
   
   // getFunction - If this metadata is function-local and recursively has a
   // function-local operand, return the first such operand's parent function.
-  // Otherwise, return null. 
+  // Otherwise, return null. getFunction() should not be used for performance-
+  // critical code because it recursively visits all the MDNode's operands.  
   Function *getFunction() const;
 
   // destroy - Delete this node.  Only when there are no uses.

Modified: llvm/trunk/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=93802&r1=93801&r2=93802&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Mon Jan 18 16:55:08 2010
@@ -154,7 +154,8 @@
 
 // getFunction - If this metadata is function-local and recursively has a
 // function-local operand, return the first such operand's parent function.
-// Otherwise, return null. 
+// Otherwise, return null. getFunction() should not be used for performance-
+// critical code because it recursively visits all the MDNode's operands.  
 Function *MDNode::getFunction() const {
 #ifndef NDEBUG
   return assertLocalFunction(this);





More information about the llvm-commits mailing list