Change library search methods to return Optional instead of ErrorOr.
authorPete Cooper <peter_cooper@apple.com>
Thu, 31 Mar 2016 01:09:35 +0000 (01:09 +0000)
committerPete Cooper <peter_cooper@apple.com>
Thu, 31 Mar 2016 01:09:35 +0000 (01:09 +0000)
commitd0a643e7dc653a0578865638cd10b23e7dd5f577
tree3c13f75960bf0174a7203ded1e935c70fce56082
parentdc59c794d081cf759a7a24bee8b8a73afbabbf02
Change library search methods to return Optional instead of ErrorOr.

These methods weren't really throwing errors.  The only error used
was that a file could not be found, which isn't really an error at all
as we are searching paths and libraries for a file.  All of the callers
also ignored errors and just used the returned path if one was available.

Changing to return Optional<StringRef> as that actually reflects what
we are trying to do here: optionally find a given path.

llvm-svn: 264979
lld/include/lld/ReaderWriter/MachOLinkingContext.h
lld/lib/Driver/DarwinLdDriver.cpp
lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp