Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot llvmbot added clang Clang issues not falling into any other category backend:SystemZ clang:frontend Language frontend issues, e.g. anything involving "Sema" labels May 16, 2025
@kazutakahirata kazutakahirata requested a review from erichkeane May 16, 2025 01:39
@llvmbot
Copy link
Member

llvmbot commented May 16, 2025

@llvm/pr-subscribers-backend-systemz

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/140172.diff

1 Files Affected:

  • (modified) clang/lib/Basic/Targets/SystemZ.cpp (+2-2)
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());

@kazutakahirata kazutakahirata merged commit 0f0fd62 into llvm:main May 16, 2025
15 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_std_optional_value_or_clang branch May 16, 2025 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:SystemZ clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants