[llvm] r225915 - Utils: Move cloneMD*() up, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Tue Jan 13 17:21:24 PST 2015
Author: dexonsmith
Date: Tue Jan 13 19:21:24 2015
New Revision: 225915
URL: http://llvm.org/viewvc/llvm-project?rev=225915&view=rev
Log:
Utils: Move cloneMD*() up, NFC
Modified:
llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=225915&r1=225914&r2=225915&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Tue Jan 13 19:21:24 2015
@@ -180,6 +180,29 @@ static Metadata *mapMetadataOp(Metadata
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.
///
/// Distinct nodes are not uniqued, so they must always recreated.
@@ -219,29 +242,6 @@ static bool shouldRemapUniquedNode(const
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.
///
/// Uniqued nodes may not need to be recreated (they may map to themselves).
More information about the llvm-commits
mailing list