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

View File

@ -192,6 +192,14 @@ static TempMDLocation cloneMDLocation(const MDLocation *Node) {
Node->getInlinedAt());
}
static TempGenericDwarfNode
cloneGenericDwarfNode(const GenericDwarfNode *Node) {
SmallVector<Metadata *, 4> DwarfOps;
DwarfOps.append(Node->dwarf_op_begin(), Node->dwarf_op_end());
return GenericDwarfNode::getTemporary(Node->getContext(), Node->getTag(),
Node->getHeader(), DwarfOps);
}
static TempMDNode cloneMDNode(const MDNode *Node) {
switch (Node->getMetadataID()) {
default: