[llvm] b68a38a - [LTO] Use std::optional in LTO.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 15:29:35 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T15:29:30-08:00
New Revision: b68a38a960d8266aff9600c69c1080dbbef33ec7

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

LOG: [LTO] Use std::optional in LTO.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/LTO/LTO.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 6e7fde62d6c52..54c173295172c 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -57,6 +57,7 @@
 #include "llvm/Transforms/Utils/FunctionImportUtils.h"
 #include "llvm/Transforms/Utils/SplitModule.h"
 
+#include <optional>
 #include <set>
 
 using namespace llvm;
@@ -1254,7 +1255,7 @@ class InProcessThinBackend : public ThinBackendProc {
   std::set<GlobalValue::GUID> CfiFunctionDefs;
   std::set<GlobalValue::GUID> CfiFunctionDecls;
 
-  Optional<Error> Err;
+  std::optional<Error> Err;
   std::mutex ErrMu;
 
   bool ShouldEmitIndexFiles;


        


More information about the llvm-commits mailing list