IR: Introduce GenericDwarfNode

As part of PR22235, introduce `DwarfNode` and `GenericDwarfNode`.  The
former is a metadata node with a DWARF tag.  The latter matches our
current (generic) schema of a header with string (and stringified
integer) data and an arbitrary number of operands.

This doesn't move it into place yet; that change will require a large
number of testcase updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226529 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-01-20 00:01:43 +00:00
parent aec6749999
commit 0a9f921686
8 changed files with 249 additions and 18 deletions
+3 -3
View File
@@ -180,11 +180,11 @@ namespace llvm {
static const Metadata *get_hashable_data(const MDOperand &X) { return X.get(); }
}
unsigned MDNodeOpsKey::calculateHash(MDNode *N) {
unsigned Hash = hash_combine_range(N->op_begin(), N->op_end());
unsigned MDNodeOpsKey::calculateHash(MDNode *N, unsigned Offset) {
unsigned Hash = hash_combine_range(N->op_begin() + Offset, N->op_end());
#ifndef NDEBUG
{
SmallVector<Metadata *, 8> MDs(N->op_begin(), N->op_end());
SmallVector<Metadata *, 8> MDs(N->op_begin() + Offset, N->op_end());
unsigned RawHash = calculateHash(MDs);
assert(Hash == RawHash &&
"Expected hash of MDOperand to equal hash of Metadata*");