mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-27 12:26:08 +00:00
Utils: Move cloneMD*() up, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225915 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -180,6 +180,29 @@ static Metadata *mapMetadataOp(Metadata *Op, ValueToValueMapTy &VM,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Metadata *cloneMDTuple(const MDTuple *Node, ValueToValueMapTy &VM,
|
||||||
|
RemapFlags Flags,
|
||||||
|
ValueMapTypeRemapper *TypeMapper,
|
||||||
|
ValueMaterializer *Materializer) {
|
||||||
|
SmallVector<Metadata *, 4> Elts;
|
||||||
|
Elts.reserve(Node->getNumOperands());
|
||||||
|
for (unsigned I = 0, E = Node->getNumOperands(); I != E; ++I)
|
||||||
|
Elts.push_back(mapMetadataOp(Node->getOperand(I), VM, Flags, TypeMapper,
|
||||||
|
Materializer));
|
||||||
|
|
||||||
|
return MDTuple::get(Node->getContext(), Elts);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Metadata *cloneMDLocation(const MDLocation *Node, ValueToValueMapTy &VM,
|
||||||
|
RemapFlags Flags,
|
||||||
|
ValueMapTypeRemapper *TypeMapper,
|
||||||
|
ValueMaterializer *Materializer) {
|
||||||
|
return MDLocation::get(
|
||||||
|
Node->getContext(), Node->getLine(), Node->getColumn(),
|
||||||
|
mapMetadataOp(Node->getScope(), VM, Flags, TypeMapper, Materializer),
|
||||||
|
mapMetadataOp(Node->getInlinedAt(), VM, Flags, TypeMapper, Materializer));
|
||||||
|
}
|
||||||
|
|
||||||
/// \brief Map a distinct MDNode.
|
/// \brief Map a distinct MDNode.
|
||||||
///
|
///
|
||||||
/// Distinct nodes are not uniqued, so they must always recreated.
|
/// Distinct nodes are not uniqued, so they must always recreated.
|
||||||
@@ -219,29 +242,6 @@ static bool shouldRemapUniquedNode(const UniquableMDNode *Node,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Metadata *cloneMDTuple(const MDTuple *Node, ValueToValueMapTy &VM,
|
|
||||||
RemapFlags Flags,
|
|
||||||
ValueMapTypeRemapper *TypeMapper,
|
|
||||||
ValueMaterializer *Materializer) {
|
|
||||||
SmallVector<Metadata *, 4> Elts;
|
|
||||||
Elts.reserve(Node->getNumOperands());
|
|
||||||
for (unsigned I = 0, E = Node->getNumOperands(); I != E; ++I)
|
|
||||||
Elts.push_back(mapMetadataOp(Node->getOperand(I), VM, Flags, TypeMapper,
|
|
||||||
Materializer));
|
|
||||||
|
|
||||||
return MDTuple::get(Node->getContext(), Elts);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Metadata *cloneMDLocation(const MDLocation *Node, ValueToValueMapTy &VM,
|
|
||||||
RemapFlags Flags,
|
|
||||||
ValueMapTypeRemapper *TypeMapper,
|
|
||||||
ValueMaterializer *Materializer) {
|
|
||||||
return MDLocation::get(
|
|
||||||
Node->getContext(), Node->getLine(), Node->getColumn(),
|
|
||||||
mapMetadataOp(Node->getScope(), VM, Flags, TypeMapper, Materializer),
|
|
||||||
mapMetadataOp(Node->getInlinedAt(), VM, Flags, TypeMapper, Materializer));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief Map a uniqued MDNode.
|
/// \brief Map a uniqued MDNode.
|
||||||
///
|
///
|
||||||
/// Uniqued nodes may not need to be recreated (they may map to themselves).
|
/// Uniqued nodes may not need to be recreated (they may map to themselves).
|
||||||
|
Reference in New Issue
Block a user