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

Part of PR21532.

llvm-svn: 222212
This commit is contained in:
Duncan P. N. Exon Smith 2014-11-18 02:20:29 +00:00
parent c23610b1e4
commit 4db24cc49b
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)