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/CodeGen/MachineFunctionSplitter.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/CodeGen/MachineFunctionSplitter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunctionSplitter.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineFunctionSplitter.cpp b/llvm/lib/CodeGen/MachineFunctionSplitter.cpp index 7d0f294..81c97ba 100644 --- a/llvm/lib/CodeGen/MachineFunctionSplitter.cpp +++ b/llvm/lib/CodeGen/MachineFunctionSplitter.cpp @@ -106,9 +106,8 @@ bool MachineFunctionSplitter::runOnMachineFunction(MachineFunction &MF) { // We don't want to proceed further for cold functions // or functions of unknown hotness. Lukewarm functions have no prefix. Optional<StringRef> SectionPrefix = MF.getFunction().getSectionPrefix(); - if (SectionPrefix.hasValue() && - (SectionPrefix.getValue().equals("unlikely") || - SectionPrefix.getValue().equals("unknown"))) { + if (SectionPrefix && (SectionPrefix.getValue().equals("unlikely") || + SectionPrefix.getValue().equals("unknown"))) { return false; } |