Add comment that MDNode::getFunction() is not to be used by performance-critical code (currently only used by AsmWriter)

llvm-svn: 93802
This commit is contained in:
Victor Hernandez 2010-01-18 22:55:08 +00:00
parent 3338c1f5d2
commit 06828f025d
2 changed files with 4 additions and 2 deletions

View 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.

View 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);