From 9116f1fbedbd6695f607ec40b09e9ae54d49f5ba Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 15 May 2025 14:05:45 -0700 Subject: [PATCH] [Basic] Use std::optional::value_or (NFC) --- clang/lib/Basic/Targets/SystemZ.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/Basic/Targets/SystemZ.cpp b/clang/lib/Basic/Targets/SystemZ.cpp index ce532b72a89d1..13b86234eed79 100644 --- a/clang/lib/Basic/Targets/SystemZ.cpp +++ b/clang/lib/Basic/Targets/SystemZ.cpp @@ -188,8 +188,8 @@ void SystemZTargetInfo::getTargetDefines(const LangOptions &Opts, std::string Str("0x"); unsigned int Librel = 0x40000000; Librel |= V.getMajor() << 24; - Librel |= (V.getMinor() ? V.getMinor().value() : 1) << 16; - Librel |= V.getSubminor() ? V.getSubminor().value() : 0; + Librel |= V.getMinor().value_or(1) << 16; + Librel |= V.getSubminor().value_or(0); Str += llvm::utohexstr(Librel); Builder.defineMacro("__TARGET_LIB__", Str.c_str());