aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-21 18:54:18 +0000
committerDan Gohman <gohman@apple.com>2010-07-21 18:54:18 +0000
commit872814ae048df032bddf9299c850f5bda08299a9 (patch)
tree8abc3d283bd51ea3430c80b7c69f84b8e6067010 /include
parentec237ffd28f1408f524dc134220d8502e167f4d9 (diff)
downloadexternal_llvm-872814ae048df032bddf9299c850f5bda08299a9.zip
external_llvm-872814ae048df032bddf9299c850f5bda08299a9.tar.gz
external_llvm-872814ae048df032bddf9299c850f5bda08299a9.tar.bz2
Disallow null as a named metadata operand.
Make MDNode::destroy private. Fix the one thing that used MDNode::destroy, outside of MDNode itself. One should never delete or destroy an MDNode explicitly. MDNodes implicitly go away when there are no references to them (implementation details aside). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/DebugInfo.h3
-rw-r--r--include/llvm/Metadata.h6
2 files changed, 4 insertions, 5 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h
index 2b16abf..f6e7832 100644
--- a/include/llvm/Analysis/DebugInfo.h
+++ b/include/llvm/Analysis/DebugInfo.h
@@ -304,8 +304,7 @@ namespace llvm {
void dump() const;
/// replaceAllUsesWith - Replace all uses of debug info referenced by
- /// this descriptor. After this completes, the current debug info value
- /// is erased.
+ /// this descriptor.
void replaceAllUsesWith(DIDescriptor &D);
};
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index 7cfcb70..1869890 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -149,9 +149,6 @@ public:
// critical code because it recursively visits all the MDNode's operands.
const Function *getFunction() const;
- // destroy - Delete this node. Only when there are no uses.
- void destroy();
-
/// Profile - calculate a unique identifier for this MDNode to collapse
/// duplicates
void Profile(FoldingSetNodeID &ID) const;
@@ -162,6 +159,9 @@ public:
return V->getValueID() == MDNodeVal;
}
private:
+ // destroy - Delete this node. Only when there are no uses.
+ void destroy();
+
bool isNotUniqued() const {
return (getSubclassDataFromValue() & NotUniquedBit) != 0;
}