summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-02 17:12:00 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-02 17:12:00 +0000
commit4b520e5ef6abd5f109a1c646ac1e31952dd76f8f (patch)
tree6353c75bdc650cf26c5b7586cffde7673e1f8d2c /llvm/lib/Transforms
parentda4a56d1abf0aa34dcb721c4b2d704a7715c23c1 (diff)
downloadbcm5719-llvm-4b520e5ef6abd5f109a1c646ac1e31952dd76f8f.tar.gz
bcm5719-llvm-4b520e5ef6abd5f109a1c646ac1e31952dd76f8f.zip
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
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/ValueMapper.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index a72c456ef0f..f38448f1def 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;
OpenPOWER on IntegriCloud