OSDN Git Service

Linker: Split mapUnneededSubprograms into two; almost NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 2 Apr 2016 17:54:01 +0000 (17:54 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 2 Apr 2016 17:54:01 +0000 (17:54 +0000)
commit715c242f51bcce01a03e86f0cc9cedf4e5a88ce5
treeb8cf3165e489925eb73014d5c4eda5b122a8e15a
parent75949bd2cee8fdd4e31876153d04b44bab9cf4fb
Linker: Split mapUnneededSubprograms into two; almost NFC

Split the loop through compile units in mapUnneededSubprograms in two.
First, visit imported entities to ensure that we've visited all need
subprograms.  Second, visit subprograms, and drop the ones we don't
need.

Hypothetically this protects against a subprogram from one compile unit
being referenced from an imported entity in a different compile unit.  I
don't think that's valid IR (a debug info expert could confirm), but I
think the refactor makes the code more clear.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265233 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Linker/IRMover.cpp