aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-12-16 02:52:09 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-12-16 02:52:09 +0000
commit57c0f206011ce3dff01075c0b38a8c55c19c7fc9 (patch)
tree39d2a97cf680096ad5ad51528a0ff106d171a991 /include
parentbbc71b2904644bfa85d8785328dc08d61c534467 (diff)
MDNodes that refer to an instruction are local to a function; in that case, explicitly keep track of the function they are local to
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Metadata.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index c7f2b445ee..320944bf24 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -111,13 +111,16 @@ class MDNode : public MetadataBase, public FoldingSetNode {
ElementVH *Node;
unsigned NodeSize;
+ Function *LocalFunction;
protected:
- explicit MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals);
+ explicit MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals,
+ Function *LocalFunction = NULL);
public:
// Constructors and destructors.
static MDNode *get(LLVMContext &Context,
- Value *const *Vals, unsigned NumVals);
+ Value *const *Vals, unsigned NumVals,
+ Function *LocalFunction = NULL);
/// ~MDNode - Destroy MDNode.
~MDNode();
@@ -130,6 +133,9 @@ public:
/// getNumElements - Return number of MDNode elements.
unsigned getNumElements() const { return NodeSize; }
+
+ /// isFunctionLocal - Return whether MDNode is local to a function.
+ bool isFunctionLocal() const { return LocalFunction; }
/// Profile - calculate a unique identifier for this MDNode to collapse
/// duplicates