aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-sim/llvm-sim.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-06-25 21:42:52 -0700
committerKazu Hirata <kazu@google.com>2022-06-25 21:42:52 -0700
commita7938c74f16379704fbd38a3d82dfcb9345651ab (patch)
treec60b0dce73b749e64ab20d51ef00abfbc547857f /llvm/tools/llvm-sim/llvm-sim.cpp
parent77295c5486e48a4319efcfc4ac262304c7e7025c (diff)
downloadllvm-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/tools/llvm-sim/llvm-sim.cpp')
-rw-r--r--llvm/tools/llvm-sim/llvm-sim.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/tools/llvm-sim/llvm-sim.cpp b/llvm/tools/llvm-sim/llvm-sim.cpp
index 26e370f..6879d73 100644
--- a/llvm/tools/llvm-sim/llvm-sim.cpp
+++ b/llvm/tools/llvm-sim/llvm-sim.cpp
@@ -85,10 +85,9 @@ exportToFile(const StringRef FilePath,
Optional<unsigned> End =
getPositionInModule((*C.back()).Inst, LLVMInstNum);
- assert(Start.hasValue() &&
+ assert(Start &&
"Could not find instruction number for first instruction");
- assert(End.hasValue() &&
- "Could not find instruction number for last instruction");
+ assert(End && "Could not find instruction number for last instruction");
J.object([&] {
J.attribute("start", Start.getValue());