aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Metadata.h3
-rw-r--r--lib/VMCore/Metadata.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index 179010b165..f64978cab4 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -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.
diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp
index 8a40fed1cc..7d78395888 100644
--- a/lib/VMCore/Metadata.cpp
+++ b/lib/VMCore/Metadata.cpp
@@ -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);