Greatly simplify InputGraph.

InputGraph has too many knobs and controls that are not being used. This
patch is to remove dead code, unused features and a class. There are two
things that worth noting, besides simple dead code removal:

1. ControlNode class is removed. We had it as the base class of Group
class, but it provides no functionality particularly meaningful. We now
have shallower class hierarchy that is easier to understand.

2. InputGraph provides a feature to replace a node with its internal data.
It is being used to "expand" some type of node, such as a Linker Script
node, with its actual files. We used to have two options when replacing
it -- ExpandOnly or ExpandAndReplace. ExpandOnly was to expand it but not
remove the node from the tree. There is no use of that option in the code,
so it was a dead feature.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205369 91177308-0d34-0410-b5e6-96231b3b80d8
Remove duplicate code in unit tests carried in from main code.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205371 91177308-0d34-0410-b5e6-96231b3b80d8
Rename insertOneElementAt -> insertElementAt.

insertElementsAt() is removed, so "One" in insertOneElementAt() no longer
make much sense. Rename it for brevity.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205372 91177308-0d34-0410-b5e6-96231b3b80d8
Merge ELFGroup with Group.

Group class is designed for GNU LD's --start-group and --end-group. There's
no obvious need to have two classes for it -- one as an abstract base class
and the other as a concrete class.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205375 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unused enum Position::ANY and third parameter of insertElementAt().

insertElementAt()'s third parameter is not only unused but also ignored
if you pass Position::END. The actual meaning of the parameter was obscure.

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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205376 91177308-0d34-0410-b5e6-96231b3b80d8
De-virtualize InputGraph's member functions.

There's no class derived from InputGraph. Making member functions virtual
just makes it a bit inefficient.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205388 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Add -z muldefs option.

This adds -z muldefs option which is widely used over
--allow-multiple-definition.

This option is supported by the GNU linker.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205391 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Create Attribute class associated with Input files.

The attribute class holds positional attributes for Input files specified on the
command line for the Gnu flavor.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205392 91177308-0d34-0410-b5e6-96231b3b80d8
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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205394 91177308-0d34-0410-b5e6-96231b3b80d8
[TODO] revisit features TODO in the driver

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

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

No one inherits Resolver. Virtualizing the member functions was just
making it inefficient.

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

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