Add MDNode::getFunction(), which figures out the metadata's function, if it has function that it is local to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93400 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Victor Hernandez
2010-01-14 01:45:14 +00:00
parent 069e100f9a
commit c7650b4d19
2 changed files with 39 additions and 0 deletions

View File

@@ -151,6 +151,11 @@ public:
bool isFunctionLocal() const {
return (getSubclassDataFromValue() & FunctionLocalBit) != 0;
}
// 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.
Function *getFunction() const;
// destroy - Delete this node. Only when there are no uses.
void destroy();