aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemoryBuiltins.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/lib/Analysis/MemoryBuiltins.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/lib/Analysis/MemoryBuiltins.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryBuiltins.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index 3c0e494..902581b 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -501,10 +501,10 @@ Optional<StringRef> llvm::getAllocationFamily(const Value *I,
if (!TLI || !TLI->getLibFunc(*Callee, TLIFn) || !TLI->has(TLIFn))
return None;
const auto AllocData = getAllocationDataForFunction(Callee, AnyAlloc, TLI);
- if (AllocData.hasValue())
+ if (AllocData)
return mangledNameForMallocFamily(AllocData.getValue().Family);
const auto FreeData = getFreeFunctionDataForFunction(Callee, TLIFn);
- if (FreeData.hasValue())
+ if (FreeData)
return mangledNameForMallocFamily(FreeData.getValue().Family);
return None;
}
@@ -512,7 +512,7 @@ Optional<StringRef> llvm::getAllocationFamily(const Value *I,
/// isLibFreeFunction - Returns true if the function is a builtin free()
bool llvm::isLibFreeFunction(const Function *F, const LibFunc TLIFn) {
Optional<FreeFnsTy> FnData = getFreeFunctionDataForFunction(F, TLIFn);
- if (!FnData.hasValue())
+ if (!FnData)
return false;
// Check free prototype.