IR: Sink MDNode::Hash down to GenericMDNode::Hash

Part of PR21532.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222212 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2014-11-18 02:20:29 +00:00
parent 023c72e64a
commit 5d8a792eac
2 changed files with 4 additions and 6 deletions

View File

@ -164,10 +164,6 @@ protected:
llvm_unreachable("Constructor throws?");
}
// TODO: Sink this into GenericMDNode. Can't do this until operands are
// allocated at the front (currently they're at the back).
unsigned Hash;
/// \brief Subclass data enums.
enum {
/// FunctionLocalBit - This bit is set if this MDNode is function local.
@ -285,8 +281,10 @@ class GenericMDNode : public MDNode {
friend class MDNode;
friend class LLVMContextImpl;
unsigned Hash;
GenericMDNode(LLVMContext &C, ArrayRef<Value *> Vals, bool isFunctionLocal)
: MDNode(C, GenericMDNodeVal, Vals, isFunctionLocal) {}
: MDNode(C, GenericMDNodeVal, Vals, isFunctionLocal), Hash(0) {}
~GenericMDNode();
void dropAllReferences();

View File

@ -140,7 +140,7 @@ void MDNode::operator delete(void *Mem) {
MDNode::MDNode(LLVMContext &C, unsigned ID, ArrayRef<Value *> Vals,
bool isFunctionLocal)
: Metadata(C, ID), Hash(0) {
: Metadata(C, ID) {
NumOperands = Vals.size();
if (isFunctionLocal)