[MemProf] Fix buildbot error due to hasValue deprecation warning
authorTeresa Johnson <tejohnson@google.com>
Thu, 22 Sep 2022 20:26:53 +0000 (13:26 -0700)
committerTeresa Johnson <tejohnson@google.com>
Thu, 22 Sep 2022 20:26:53 +0000 (13:26 -0700)
Use has_value instead of hasValue to address a deprecation warning from
a212d8da94d08e229aa8d65283e4b116310bba10. E.g.:

https://lab.llvm.org/buildbot/#/builders/57/builds/22166/steps/5/logs/stdio

llvm/lib/Analysis/MemoryBuiltins.cpp

index 521e015..351e81a 100644 (file)
@@ -306,7 +306,7 @@ bool llvm::isAllocationFn(
 /// Tests if a value is a call or invoke to a library function that
 /// allocates memory via new.
 bool llvm::isNewLikeFn(const Value *V, const TargetLibraryInfo *TLI) {
-  return getAllocationData(V, OpNewLike, TLI).hasValue();
+  return getAllocationData(V, OpNewLike, TLI).has_value();
 }
 
 /// Tests if a value is a call or invoke to a library function that