Add comment that MDNode::getFunction() is not to be used by performance-critical...
authorVictor Hernandez <vhernandez@apple.com>
Mon, 18 Jan 2010 22:55:08 +0000 (22:55 +0000)
committerVictor Hernandez <vhernandez@apple.com>
Mon, 18 Jan 2010 22:55:08 +0000 (22:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93802 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Metadata.h
lib/VMCore/Metadata.cpp

index 179010b1657063016306fec2e7960eec7a49f20a..f64978cab44a05fe156190f94c2dc577e3bce614 100644 (file)
@@ -154,7 +154,8 @@ public:
   
   // 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.
index 8a40fed1ccadc2bc72caa86a696cefbdc2062245..7d78395888243cc453cc5fe2adbea270bbeca4ff 100644 (file)
@@ -154,7 +154,8 @@ static Function *assertLocalFunction(const MDNode *N) {
 
 // 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);