[llvm] 37c6a25 - [MemProf] Fix buildbot error due to hasValue deprecation warning

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 13:31:38 PDT 2022


Author: Teresa Johnson
Date: 2022-09-22T13:26:53-07:00
New Revision: 37c6a25e9ab230e5e21fa34e246d9fec55275df0

URL: https://github.com/llvm/llvm-project/commit/37c6a25e9ab230e5e21fa34e246d9fec55275df0
DIFF: https://github.com/llvm/llvm-project/commit/37c6a25e9ab230e5e21fa34e246d9fec55275df0.diff

LOG: [MemProf] Fix buildbot error due to hasValue deprecation warning

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

Added: 
    

Modified: 
    llvm/lib/Analysis/MemoryBuiltins.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index 521e01588f3e..351e81aac05d 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -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


        


More information about the llvm-commits mailing list