[Lldb-commits] [lldb] 570117b - [lldb] Remove remaining uses of llvm::Optional (NFC)

Kazu Hirata via lldb-commits lldb-commits at lists.llvm.org
Sat Jan 7 14:36:42 PST 2023


Author: Kazu Hirata
Date: 2023-01-07T14:36:35-08:00
New Revision: 570117b6a5c8d1bd4e611aa3087794c215753ab7

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

LOG: [lldb] Remove remaining uses of llvm::Optional (NFC)

This patch removes the unused "using" declarations, updates comments,
and removes #include "llvm/ADT/Optional.h".

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: 
    lldb/include/lldb/Breakpoint/BreakpointID.h
    lldb/include/lldb/Core/SourceLocationSpec.h
    lldb/include/lldb/Core/ValueObject.h
    lldb/include/lldb/Core/ValueObjectChild.h
    lldb/include/lldb/Host/FileSystem.h
    lldb/include/lldb/Host/linux/Host.h
    lldb/include/lldb/Symbol/ObjectFile.h
    lldb/include/lldb/Target/MemoryRegionInfo.h
    lldb/include/lldb/Target/MemoryTagMap.h
    lldb/include/lldb/Target/UnixSignals.h
    lldb/include/lldb/Utility/Diagnostics.h
    lldb/include/lldb/Utility/SelectHelper.h
    lldb/include/lldb/Utility/Timeout.h
    lldb/include/lldb/Utility/UriParser.h
    lldb/include/lldb/Utility/UserIDResolver.h
    lldb/source/Core/DumpDataExtractor.cpp
    lldb/source/Core/IOHandler.cpp
    lldb/source/Expression/DWARFExpression.cpp
    lldb/source/Plugins/ABI/ARC/ABISysV_arc.h
    lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h
    lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h
    lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
    lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h
    lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
    lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
    lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
    lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
    lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
    lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
    lldb/source/Plugins/Process/minidump/MinidumpParser.h
    lldb/source/Plugins/Process/minidump/MinidumpTypes.h
    lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
    lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h
    lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
    lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.h
    lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.h
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
    lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
    lldb/source/Utility/SelectHelper.cpp
    lldb/tools/lldb-vscode/JSONUtils.cpp
    lldb/unittests/DataFormatter/StringPrinterTests.cpp
    lldb/unittests/Process/minidump/MinidumpParserTest.cpp
    lldb/unittests/tools/lldb-server/tests/TestClient.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Breakpoint/BreakpointID.h b/lldb/include/lldb/Breakpoint/BreakpointID.h
index dff901163cb0..a62323061b75 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointID.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointID.h
@@ -12,7 +12,6 @@
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include <optional>
 

diff  --git a/lldb/include/lldb/Core/SourceLocationSpec.h b/lldb/include/lldb/Core/SourceLocationSpec.h
index 3550dc02f654..9c2512bff4b7 100644
--- a/lldb/include/lldb/Core/SourceLocationSpec.h
+++ b/lldb/include/lldb/Core/SourceLocationSpec.h
@@ -11,7 +11,6 @@
 
 #include "lldb/Core/Declaration.h"
 #include "lldb/lldb-defines.h"
-#include "llvm/ADT/Optional.h"
 
 #include <optional>
 #include <string>

diff  --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index 398c6e914cbb..a666d0bab173 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -26,7 +26,6 @@
 #include "lldb/lldb-types.h"
 
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 

diff  --git a/lldb/include/lldb/Core/ValueObjectChild.h b/lldb/include/lldb/Core/ValueObjectChild.h
index a655911bf7bd..07b37aa8a405 100644
--- a/lldb/include/lldb/Core/ValueObjectChild.h
+++ b/lldb/include/lldb/Core/ValueObjectChild.h
@@ -18,8 +18,6 @@
 #include "lldb/lldb-private-enumerations.h"
 #include "lldb/lldb-types.h"
 
-#include "llvm/ADT/Optional.h"
-
 #include <cstddef>
 #include <cstdint>
 #include <optional>

diff  --git a/lldb/include/lldb/Host/FileSystem.h b/lldb/include/lldb/Host/FileSystem.h
index aefad00ebd9b..823e7710b4ef 100644
--- a/lldb/include/lldb/Host/FileSystem.h
+++ b/lldb/include/lldb/Host/FileSystem.h
@@ -14,7 +14,6 @@
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Status.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/Chrono.h"
 #include "llvm/Support/VirtualFileSystem.h"
 

diff  --git a/lldb/include/lldb/Host/linux/Host.h b/lldb/include/lldb/Host/linux/Host.h
index 08ac41b01abe..ef1e74cd1d50 100644
--- a/lldb/include/lldb/Host/linux/Host.h
+++ b/lldb/include/lldb/Host/linux/Host.h
@@ -10,7 +10,6 @@
 #define LLDB_HOST_LINUX_HOST_H
 
 #include "lldb/lldb-types.h"
-#include "llvm/ADT/Optional.h"
 #include <optional>
 
 namespace lldb_private {

diff  --git a/lldb/include/lldb/Symbol/ObjectFile.h b/lldb/include/lldb/Symbol/ObjectFile.h
index bae6e72a3aec..4d6c8f1105a0 100644
--- a/lldb/include/lldb/Symbol/ObjectFile.h
+++ b/lldb/include/lldb/Symbol/ObjectFile.h
@@ -19,7 +19,6 @@
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/UUID.h"
 #include "lldb/lldb-private.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/Threading.h"
 #include "llvm/Support/VersionTuple.h"
 #include <optional>

diff  --git a/lldb/include/lldb/Target/MemoryRegionInfo.h b/lldb/include/lldb/Target/MemoryRegionInfo.h
index 8d639a86700e..47d4c9d63987 100644
--- a/lldb/include/lldb/Target/MemoryRegionInfo.h
+++ b/lldb/include/lldb/Target/MemoryRegionInfo.h
@@ -15,7 +15,6 @@
 
 #include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/RangeMap.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/FormatProviders.h"
 
 namespace lldb_private {

diff  --git a/lldb/include/lldb/Target/MemoryTagMap.h b/lldb/include/lldb/Target/MemoryTagMap.h
index 00543bbfe608..272f722dbfb3 100644
--- a/lldb/include/lldb/Target/MemoryTagMap.h
+++ b/lldb/include/lldb/Target/MemoryTagMap.h
@@ -11,7 +11,6 @@
 
 #include "lldb/Target/MemoryTagManager.h"
 #include "lldb/lldb-private.h"
-#include "llvm/ADT/Optional.h"
 #include <map>
 #include <optional>
 

diff  --git a/lldb/include/lldb/Target/UnixSignals.h b/lldb/include/lldb/Target/UnixSignals.h
index c9967239d4da..ff9f1ac9be19 100644
--- a/lldb/include/lldb/Target/UnixSignals.h
+++ b/lldb/include/lldb/Target/UnixSignals.h
@@ -16,7 +16,6 @@
 
 #include "lldb/Utility/ConstString.h"
 #include "lldb/lldb-private.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/JSON.h"
 
 namespace lldb_private {

diff  --git a/lldb/include/lldb/Utility/Diagnostics.h b/lldb/include/lldb/Utility/Diagnostics.h
index 225346a5127e..5d23fa8ae234 100644
--- a/lldb/include/lldb/Utility/Diagnostics.h
+++ b/lldb/include/lldb/Utility/Diagnostics.h
@@ -11,7 +11,6 @@
 
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Log.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Support/Error.h"

diff  --git a/lldb/include/lldb/Utility/SelectHelper.h b/lldb/include/lldb/Utility/SelectHelper.h
index c1263f7c5643..ea46c33c396f 100644
--- a/lldb/include/lldb/Utility/SelectHelper.h
+++ b/lldb/include/lldb/Utility/SelectHelper.h
@@ -13,7 +13,6 @@
 #include "lldb/lldb-types.h"
 
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
 
 #include <chrono>
 #include <optional>

diff  --git a/lldb/include/lldb/Utility/Timeout.h b/lldb/include/lldb/Utility/Timeout.h
index 3f7744ed3ab8..85128c557d9c 100644
--- a/lldb/include/lldb/Utility/Timeout.h
+++ b/lldb/include/lldb/Utility/Timeout.h
@@ -9,7 +9,6 @@
 #ifndef LLDB_UTILITY_TIMEOUT_H
 #define LLDB_UTILITY_TIMEOUT_H
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/Chrono.h"
 #include "llvm/Support/FormatProviders.h"
 #include <optional>

diff  --git a/lldb/include/lldb/Utility/UriParser.h b/lldb/include/lldb/Utility/UriParser.h
index b1092219d474..311cff9f4dfd 100644
--- a/lldb/include/lldb/Utility/UriParser.h
+++ b/lldb/include/lldb/Utility/UriParser.h
@@ -9,7 +9,6 @@
 #ifndef LLDB_UTILITY_URIPARSER_H
 #define LLDB_UTILITY_URIPARSER_H
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include <optional>
 

diff  --git a/lldb/include/lldb/Utility/UserIDResolver.h b/lldb/include/lldb/Utility/UserIDResolver.h
index e9f58367a39b..45dad6b3aef3 100644
--- a/lldb/include/lldb/Utility/UserIDResolver.h
+++ b/lldb/include/lldb/Utility/UserIDResolver.h
@@ -10,7 +10,6 @@
 #define LLDB_UTILITY_USERIDRESOLVER_H
 
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include <mutex>
 #include <optional>

diff  --git a/lldb/source/Core/DumpDataExtractor.cpp b/lldb/source/Core/DumpDataExtractor.cpp
index 17025ef8aa17..7f6108f40c59 100644
--- a/lldb/source/Core/DumpDataExtractor.cpp
+++ b/lldb/source/Core/DumpDataExtractor.cpp
@@ -30,7 +30,6 @@
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 
 #include <limits>

diff  --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp
index 443ca86fe8f8..95957b6948fc 100644
--- a/lldb/source/Core/IOHandler.cpp
+++ b/lldb/source/Core/IOHandler.cpp
@@ -50,7 +50,6 @@
 
 using namespace lldb;
 using namespace lldb_private;
-using llvm::Optional;
 using llvm::StringRef;
 
 IOHandler::IOHandler(Debugger &debugger, IOHandler::Type type)

diff  --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index 682ead966e8d..47cef1b35180 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -799,7 +799,7 @@ void UpdateValueTypeFromLocationDescription(Log *log, const DWARFUnit *dwarf_cu,
 /// \param so_addr out parameter, will be set to load address or section offset
 /// \param check_sectionoffset bool which determines if having a section offset
 ///                            but not a load address is considerd a success
-/// \returns llvm::Optional containing the load address if resolving and getting
+/// \returns std::optional containing the load address if resolving and getting
 ///          the load address succeed or an empty Optinal otherwise. If
 ///          check_sectionoffset is true we consider LLDB_INVALID_ADDRESS a
 ///          success if so_addr.IsSectionOffset() is true.

diff  --git a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.h b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.h
index d5358c1a6ad1..de513453f2a2 100644
--- a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.h
+++ b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.h
@@ -10,7 +10,6 @@
 #define liblldb_ABISysV_arc_h_
 
 // Other libraries and framework includes
-#include <llvm/ADT/Optional.h>
 #include <optional>
 
 // Project includes

diff  --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h
index 6104e40277db..68ae3a32e18f 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h
+++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h
@@ -17,7 +17,6 @@
 #include "lldb/Core/Address.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/PluginManager.h"
-#include "llvm/ADT/Optional.h"
 
 class InstructionLLVMC;
 

diff  --git a/lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h b/lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h
index d9c2ffbe9cbf..252cef805408 100644
--- a/lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h
+++ b/lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h
@@ -14,7 +14,6 @@
 #include <variant>
 
 #include "llvm/ADT/APFloat.h"
-#include "llvm/ADT/Optional.h"
 
 namespace lldb_private {
 

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
index a835f8116e0a..617181a35d1d 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
@@ -16,7 +16,6 @@
 
 using namespace lldb;
 using namespace lldb_private;
-using llvm::Optional;
 using ParsedFunction = lldb_private::CPlusPlusNameParser::ParsedFunction;
 using ParsedName = lldb_private::CPlusPlusNameParser::ParsedName;
 namespace tok = clang::tok;

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h
index 77482f6d8e8f..326efb7a8be0 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h
@@ -10,7 +10,6 @@
 #define LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_CPLUSPLUSNAMEPARSER_H
 
 #include "clang/Lex/Lexer.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
index e4956b375363..4e54e7b5b7fa 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
@@ -12,7 +12,6 @@
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Utility/LLDBAssert.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/ScopeExit.h"
 #include <optional>
 

diff  --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
index 4c456dda5fd9..cfeec3d679be 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
@@ -9,7 +9,6 @@
 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_APPLEOBJCRUNTIME_APPLEOBJCRUNTIME_H
 #define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_APPLEOBJCRUNTIME_APPLEOBJCRUNTIME_H
 
-#include "llvm/ADT/Optional.h"
 
 #include "AppleObjCTrampolineHandler.h"
 #include "AppleThreadPlanStepThroughObjCTrampoline.h"

diff  --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
index 0281196865de..e68f0a4bc8bd 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
@@ -15,7 +15,6 @@
 
 #include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h"
 
-#include "llvm/ADT/Optional.h"
 
 #include "AdbClient.h"
 

diff  --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
index eed8611bfb85..e5b75fd8dc26 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
@@ -17,7 +17,6 @@
 #include "lldb/Utility/Status.h"
 #include "lldb/Utility/XcodeSDK.h"
 #include "lldb/lldb-forward.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Triple.h"

diff  --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
index 393d99f45048..4b564bba7de0 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
@@ -20,7 +20,6 @@
 #include "lldb/Utility/StructuredData.h"
 #include "lldb/Utility/XcodeSDK.h"
 #include "lldb/lldb-forward.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"

diff  --git a/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h b/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
index 05d946fcfc61..1889be65e196 100644
--- a/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
+++ b/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
@@ -25,7 +25,6 @@ typedef void *id;
 #include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/Status.h"
 
-#include "llvm/ADT/Optional.h"
 
 // And now the actual magic
 namespace CoreSimulatorSupport {

diff  --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
index d3b03446092f..45ea2f2589c1 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -29,7 +29,6 @@
 #include "lldb/Host/windows/PosixApi.h"
 #endif
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/VersionTuple.h"
 
 namespace lldb_private {

diff  --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
index 97805f2130b8..1853025466cf 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
@@ -17,7 +17,6 @@
 #include "GDBRemoteCommunicationServerCommon.h"
 #include "lldb/Host/Socket.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/Error.h"
 
 namespace lldb_private {

diff  --git a/lldb/source/Plugins/Process/minidump/MinidumpParser.h b/lldb/source/Plugins/Process/minidump/MinidumpParser.h
index 083131450d5e..050ba086f46f 100644
--- a/lldb/source/Plugins/Process/minidump/MinidumpParser.h
+++ b/lldb/source/Plugins/Process/minidump/MinidumpParser.h
@@ -19,7 +19,6 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Object/Minidump.h"
 

diff  --git a/lldb/source/Plugins/Process/minidump/MinidumpTypes.h b/lldb/source/Plugins/Process/minidump/MinidumpTypes.h
index 8c80a8cfa083..fe99abf9e24e 100644
--- a/lldb/source/Plugins/Process/minidump/MinidumpTypes.h
+++ b/lldb/source/Plugins/Process/minidump/MinidumpTypes.h
@@ -13,7 +13,6 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/BitmaskEnum.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/Minidump.h"

diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
index 72238e3f59ca..af7e5e950840 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
@@ -10,7 +10,6 @@
 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DIEREF_H
 
 #include "lldb/Core/dwarf.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/FormatProviders.h"
 #include <cassert>
 #include <optional>

diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h
index cc5168cb0ee1..7df776b5f514 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h
@@ -11,7 +11,6 @@
 
 #include "DWARFDataExtractor.h"
 #include "lldb/Core/Section.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
 #include "llvm/Support/Threading.h"
 #include <memory>

diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
index 3cbfda47ff7d..90e07ea67f53 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -10,7 +10,6 @@
 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFFORMVALUE_H
 
 #include "DWARFDataExtractor.h"
-#include "llvm/ADT/Optional.h"
 #include <cstddef>
 #include <optional>
 

diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 4efa2c1830db..426e6b98dfdb 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -8,7 +8,6 @@
 
 #include "SymbolFileDWARF.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/Threading.h"

diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.h b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.h
index ef9110b3df3c..c6e382d3825c 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.h
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.h
@@ -13,7 +13,6 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/IntervalMap.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
 #include "llvm/DebugInfo/CodeView/StringsAndChecksums.h"
 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"

diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.h b/lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.h
index 57d682210a2f..796aa4c8dfd1 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.h
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.h
@@ -11,7 +11,6 @@
 
 #include "lldb/lldb-types.h"
 #include "llvm/ADT/IntervalMap.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
 

diff  --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h
index 303a1124cec4..e1a35c6f121a 100644
--- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h
+++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h
@@ -11,7 +11,6 @@
 
 #include "lldb/lldb-types.h"
 #include <cstddef>
-#include <llvm/ADT/Optional.h>
 #include <optional>
 
 namespace lldb_private {

diff  --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
index 3f6fcd274603..93156aa4aa9e 100644
--- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
+++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
@@ -11,7 +11,6 @@
 
 #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h"
 #include "lldb/lldb-types.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/JSON.h"
 #include <intel-pt.h>
 #include <optional>

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index 2f30b56d8efa..74daecbdfc3d 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -1159,7 +1159,7 @@ class ScratchTypeSystemClang : public TypeSystemClang {
   };
 
   /// Alias for requesting the default scratch TypeSystemClang in GetForTarget.
-  // This isn't constexpr as gtest/llvm::Optional comparison logic is trying
+  // This isn't constexpr as gtest/std::optional comparison logic is trying
   // to get the address of this for pretty-printing.
   static const std::nullopt_t DefaultAST;
 

diff  --git a/lldb/source/Utility/SelectHelper.cpp b/lldb/source/Utility/SelectHelper.cpp
index a6032a3e8eed..b7d9e19bc7cb 100644
--- a/lldb/source/Utility/SelectHelper.cpp
+++ b/lldb/source/Utility/SelectHelper.cpp
@@ -20,7 +20,6 @@
 #include "lldb/lldb-types.h"
 
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
 
 #include <algorithm>
 #include <chrono>

diff  --git a/lldb/tools/lldb-vscode/JSONUtils.cpp b/lldb/tools/lldb-vscode/JSONUtils.cpp
index 82f591148811..8ec38a495777 100644
--- a/lldb/tools/lldb-vscode/JSONUtils.cpp
+++ b/lldb/tools/lldb-vscode/JSONUtils.cpp
@@ -12,7 +12,6 @@
 #include <sstream>
 #include <string.h>
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/FormatAdapters.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/ScopedPrinter.h"

diff  --git a/lldb/unittests/DataFormatter/StringPrinterTests.cpp b/lldb/unittests/DataFormatter/StringPrinterTests.cpp
index 5badd825a766..ac4116139beb 100644
--- a/lldb/unittests/DataFormatter/StringPrinterTests.cpp
+++ b/lldb/unittests/DataFormatter/StringPrinterTests.cpp
@@ -10,7 +10,6 @@
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/StreamString.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/raw_ostream.h"
 #include "gtest/gtest.h"
@@ -20,7 +19,6 @@
 using namespace lldb;
 using namespace lldb_private;
 using lldb_private::formatters::StringPrinter;
-using llvm::Optional;
 using llvm::StringRef;
 
 #define QUOTE(x) std::string("\"" x "\"")

diff  --git a/lldb/unittests/Process/minidump/MinidumpParserTest.cpp b/lldb/unittests/Process/minidump/MinidumpParserTest.cpp
index eded318344b3..632a7fd4e4f8 100644
--- a/lldb/unittests/Process/minidump/MinidumpParserTest.cpp
+++ b/lldb/unittests/Process/minidump/MinidumpParserTest.cpp
@@ -19,7 +19,6 @@
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/FileSpec.h"
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ObjectYAML/yaml2obj.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/MemoryBuffer.h"

diff  --git a/lldb/unittests/tools/lldb-server/tests/TestClient.h b/lldb/unittests/tools/lldb-server/tests/TestClient.h
index 09d7131adf40..9a1831d4dbc1 100644
--- a/lldb/unittests/tools/lldb-server/tests/TestClient.h
+++ b/lldb/unittests/tools/lldb-server/tests/TestClient.h
@@ -14,7 +14,6 @@
 #include "lldb/Host/ProcessLaunchInfo.h"
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/Connection.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/FormatVariadic.h"
 #include <memory>


        


More information about the lldb-commits mailing list