[llvm] r222212 - IR: Sink MDNode::Hash down to GenericMDNode::Hash

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Nov 17 18:20:29 PST 2014


Author: dexonsmith
Date: Mon Nov 17 20:20:29 2014
New Revision: 222212

URL: http://llvm.org/viewvc/llvm-project?rev=222212&view=rev
Log:
IR: Sink MDNode::Hash down to GenericMDNode::Hash

Part of PR21532.

Modified:
    llvm/trunk/include/llvm/IR/Metadata.h
    llvm/trunk/lib/IR/Metadata.cpp

Modified: llvm/trunk/include/llvm/IR/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.h?rev=222212&r1=222211&r2=222212&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Metadata.h (original)
+++ llvm/trunk/include/llvm/IR/Metadata.h Mon Nov 17 20:20:29 2014
@@ -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();

Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=222212&r1=222211&r2=222212&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Mon Nov 17 20:20:29 2014
@@ -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)





More information about the llvm-commits mailing list