diff options
author | Shoaib Meenai <smeenai@fb.com> | 2020-08-15 11:41:57 -0700 |
---|---|---|
committer | Shoaib Meenai <smeenai@fb.com> | 2020-08-15 11:41:57 -0700 |
commit | 93c761f5e5b05c8ee54062f43d9c34bb75a0c2bb (patch) | |
tree | 29043b5efde379fdd4e4bd0793ba3a2ac989d162 /llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp | |
parent | 160c133be5e12899e7c86af9604bddd08a9a2681 (diff) | |
download | llvm-93c761f5e5b05c8ee54062f43d9c34bb75a0c2bb.zip llvm-93c761f5e5b05c8ee54062f43d9c34bb75a0c2bb.tar.gz llvm-93c761f5e5b05c8ee54062f43d9c34bb75a0c2bb.tar.bz2 |
[llvm-libtool-darwin] Use Optional operator overloads. NFC
Use operator bool instead of hasValue and operator* instead of getValue
to simplify the code slightly.
Diffstat (limited to 'llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp')
-rw-r--r-- | llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp index a91f783..e861b46 100644 --- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp +++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp @@ -108,10 +108,10 @@ static Expected<std::string> searchForFile(const Twine &FileName) { }; Optional<std::string> Found = FindLib(LibrarySearchDirs); - if (!Found.hasValue()) + if (!Found) Found = FindLib(StandardSearchDirs); - if (Found.hasValue()) - return Found.getValue(); + if (Found) + return *Found; return createStringError(std::errc::invalid_argument, "cannot locate file '%s'", FileName.str().c_str()); |