Move nextFile() from LinkingContext to InputGraph.
authorRui Ueyama <ruiu@google.com>
Wed, 2 Apr 2014 05:03:40 +0000 (05:03 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 2 Apr 2014 05:03:40 +0000 (05:03 +0000)
commiteb4b54349d1917e7054cdcb1360f1b5a054c09ef
tree8605ca199c4dd9f0d19189a71df7a7de904e9eed
parent2895496852ea2adf9be8418aad101eee2b063f7f
Move nextFile() from LinkingContext to InputGraph.

LinkingContext and InputGraph are unnecessarily entangled. Most linker
input file data, e.g. the vector containing input files, the next index
of the input file, etc. are managed by InputGraph, but only the current
input file is for no obvious reason managed by LinkingContext.

This patch is to move code from LinkingContext to InputGraph to fix it.
It's now clear who's reponsible for managing input file state, which is
InputGraph, and LinkingContext is now free from that responsibility.
It improves the readability as we now have fewer dependencies between
classes. No functionality change.

Differential Revision: http://llvm-reviews.chandlerc.com/D3259

llvm-svn: 205394
lld/include/lld/Core/InputGraph.h
lld/include/lld/Core/LinkingContext.h
lld/lib/Core/InputGraph.cpp
lld/lib/Core/LinkingContext.cpp
lld/lib/Core/Resolver.cpp