[llvm] 90cfbb8 - Add LLVM_VALUE_FUNCTION to Optional::map(); NFC
Aaron Ballman via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 22 11:21:17 PST 2020
Author: Aaron Ballman
Date: 2020-01-22T14:21:08-05:00
New Revision: 90cfbb81674ecd38030e2656acaed4f3c39b5e62
URL: https://github.com/llvm/llvm-project/commit/90cfbb81674ecd38030e2656acaed4f3c39b5e62
DIFF: https://github.com/llvm/llvm-project/commit/90cfbb81674ecd38030e2656acaed4f3c39b5e62.diff
LOG: Add LLVM_VALUE_FUNCTION to Optional::map(); NFC
This is for future-proofing when compiling with MSVC once we drop support for 2017.
Added:
Modified:
llvm/include/llvm/ADT/Optional.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/Optional.h b/llvm/include/llvm/ADT/Optional.h
index c84f9aa8b342..c64b82352397 100644
--- a/llvm/include/llvm/ADT/Optional.h
+++ b/llvm/include/llvm/ADT/Optional.h
@@ -269,7 +269,7 @@ template <typename T> class Optional {
/// Apply a function to the value if present; otherwise return None.
template <class Function>
- auto map(const Function &F) const
+ auto map(const Function &F) const LLVM_LVALUE_FUNCTION
-> Optional<decltype(F(getValue()))> {
if (*this) return F(getValue());
return None;
More information about the llvm-commits
mailing list