[MemProf] llvm::Optional => std::optional
authorFangrui Song <i@maskray.me>
Tue, 13 Dec 2022 08:15:56 +0000 (08:15 +0000)
committerFangrui Song <i@maskray.me>
Tue, 13 Dec 2022 08:15:56 +0000 (08:15 +0000)
llvm/lib/Transforms/Instrumentation/MemProfiler.cpp

index 6d39c6d..2a1601f 100644 (file)
@@ -172,7 +172,7 @@ public:
   /// If it is an interesting memory access, populate information
   /// about the access and return a InterestingMemoryAccess struct.
   /// Otherwise return std::nullopt.
-  Optional<InterestingMemoryAccess>
+  std::optional<InterestingMemoryAccess>
   isInterestingMemoryAccess(Instruction *I) const;
 
   void instrumentMop(Instruction *I, const DataLayout &DL,
@@ -267,7 +267,7 @@ void MemProfiler::instrumentMemIntrinsic(MemIntrinsic *MI) {
   MI->eraseFromParent();
 }
 
-Optional<InterestingMemoryAccess>
+std::optional<InterestingMemoryAccess>
 MemProfiler::isInterestingMemoryAccess(Instruction *I) const {
   // Do not instrument the load fetching the dynamic shadow address.
   if (DynamicShadowOffset == I)
@@ -585,7 +585,7 @@ bool MemProfiler::instrumentFunction(Function &F) {
   for (auto *Inst : ToInstrument) {
     if (ClDebugMin < 0 || ClDebugMax < 0 ||
         (NumInstrumented >= ClDebugMin && NumInstrumented <= ClDebugMax)) {
-      Optional<InterestingMemoryAccess> Access =
+      std::optional<InterestingMemoryAccess> Access =
           isInterestingMemoryAccess(Inst);
       if (Access)
         instrumentMop(Inst, F.getParent()->getDataLayout(), *Access);