[llvm] cec2376 - [IR] Use std::optional in Verifier.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 12:11:50 PST 2022


Author: Kazu Hirata
Date: 2022-11-25T12:11:44-08:00
New Revision: cec2376f58e099820f57ecd666241cef6747c7cc

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

LOG: [IR] Use std::optional in Verifier.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

Added: 
    

Modified: 
    llvm/lib/IR/Verifier.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index ce0d4da8f4e8..67eabcac30c3 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -109,6 +109,7 @@
 #include <cassert>
 #include <cstdint>
 #include <memory>
+#include <optional>
 #include <string>
 #include <utility>
 
@@ -6470,7 +6471,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode,
 
   bool Failed = false;
 
-  Optional<APInt> PrevOffset;
+  std::optional<APInt> PrevOffset;
   unsigned BitWidth = ~0u;
 
   // We've already checked that BaseNode is not a degenerate root node with one


        


More information about the llvm-commits mailing list