diff options
author | Kazu Hirata <kazu@google.com> | 2022-06-25 21:42:52 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-06-25 21:42:52 -0700 |
commit | a7938c74f16379704fbd38a3d82dfcb9345651ab (patch) | |
tree | c60b0dce73b749e64ab20d51ef00abfbc547857f /llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | |
parent | 77295c5486e48a4319efcfc4ac262304c7e7025c (diff) | |
download | llvm-a7938c74f16379704fbd38a3d82dfcb9345651ab.zip llvm-a7938c74f16379704fbd38a3d82dfcb9345651ab.tar.gz llvm-a7938c74f16379704fbd38a3d82dfcb9345651ab.tar.bz2 |
[llvm] Don't use Optional::hasValue (NFC)
This patch replaces Optional::hasValue with the implicit cast to bool
in conditionals only.
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index dd7a9fe..fe396cb 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -246,10 +246,10 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT, static Reloc::Model getEffectiveRelocModel(const Triple &TT, Optional<Reloc::Model> RM) { - assert((!TT.isOSAIX() || !RM.hasValue() || *RM == Reloc::PIC_) && + assert((!TT.isOSAIX() || !RM || *RM == Reloc::PIC_) && "Invalid relocation model for AIX."); - if (RM.hasValue()) + if (RM) return *RM; // Big Endian PPC and AIX default to PIC. |