Make File non-const in the resolver.
authorRui Ueyama <ruiu@google.com>
Wed, 4 Mar 2015 04:36:46 +0000 (04:36 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 4 Mar 2015 04:36:46 +0000 (04:36 +0000)
commit394d10e34d01415897b6af28f7fceaeb5a9088f2
tree350d1297c7b263fba845af6a4621be8de04d883a
parentb480296e6cb4a2cc5d5f588e35d4148f8770fea9
Make File non-const in the resolver.

File objects are not really const in the resolver. We set ordinals to
them and call beforeLink hooks. Also, File's member functions marked
as const are not really const. ArchiveFile never returns the same
member file twice, so it remembers files returned before. find() has
side effects.

In order to deal with the inconsistencies, we sprinkled const_casts
and marked member varaibles as mutable.

This patch removes const from there to reflect the reality.

llvm-svn: 231212
lld/include/lld/Core/ArchiveLibraryFile.h
lld/include/lld/Core/Resolver.h
lld/lib/Core/Resolver.cpp
lld/lib/ReaderWriter/FileArchive.cpp
lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp
lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp