Remove code duplication.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@224206 91177308-0d34-0410-b5e6-96231b3b80d8
Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@224207 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify InputGraph API.

These member functions returns either no_more_files error or a File object.
We could simply return a nullptr instead of a no_more_files.
This function will be removed soon as a part of InputGraph cleanup.
I had to do that step by step.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@224208 91177308-0d34-0410-b5e6-96231b3b80d8