[llvm] b77a88c - [Analysis] Use std::optional in IRSimilarityIdentifier.h (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 11:49:23 PST 2022


Author: Kazu Hirata
Date: 2022-11-27T11:49:03-08:00
New Revision: b77a88c42e0c35b12eb54fbc459580adfc1531ba

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

LOG: [Analysis] Use std::optional in IRSimilarityIdentifier.h (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/include/llvm/Analysis/IRSimilarityIdentifier.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
index a3f1c1335cac..fd14104c2395 100644
--- a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
+++ b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
@@ -54,6 +54,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/Allocator.h"
+#include <optional>
 
 namespace llvm {
 class Module;
@@ -127,7 +128,7 @@ struct IRInstructionData
   /// This is only relevant if we are wrapping a CmpInst where we needed to
   /// change the predicate of a compare instruction from a greater than form
   /// to a less than form.  It is None otherwise.
-  Optional<CmpInst::Predicate> RevisedPredicate;
+  std::optional<CmpInst::Predicate> RevisedPredicate;
 
   /// This is only relevant if we are wrapping a CallInst. If we are requiring
   /// that the function calls have matching names as well as types, and the
@@ -137,7 +138,7 @@ struct IRInstructionData
   /// function call type.  The value held here is used to create the hash of the
   /// instruction, and check to make sure two instructions are close to one
   /// another.
-  Optional<std::string> CalleeName;
+  std::optional<std::string> CalleeName;
 
   /// This structure holds the distances of how far "ahead of" or "behind" the
   /// target blocks of a branch, or the incoming blocks of a phi nodes are.


        


More information about the llvm-commits mailing list