From 4b520e5ef6abd5f109a1c646ac1e31952dd76f8f Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 2 Apr 2016 17:12:00 +0000 Subject: Linker: Remove IRMover::isMetadataUnneeded indirection; almost NFC Instead of checking live during MapMetadata whether a subprogram is needed, seed the ValueMap with `nullptr` up-front. There is a small hypothetical functionality change. Previously, calling MapMetadataOp on a node whose "scope:" chain led to an unneeded subprogram would return nullptr. However, if that were ever called, then the subprogram would be needed; a situation that the IRMover is supposed to avoid a priori! Besides cleaning up the code a little, this restores a nice property: MapMetadataOp returns the same as MapMetadata. llvm-svn: 265229 --- llvm/lib/Transforms/Utils/ValueMapper.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp') diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index a72c456..f38448f 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -190,9 +190,6 @@ static Metadata *mapMetadataOp(Metadata *Op, if (!Op) return nullptr; - if (Materializer && !Materializer->isMetadataNeeded(Op)) - return nullptr; - if (Metadata *MappedOp = MapMetadataImpl(Op, DistinctWorklist, VM, Flags, TypeMapper, Materializer)) return MappedOp; -- cgit v1.1