EXPECT_TRUE(without_column);
EXPECT_EQ(fs, without_column.GetFileSpec());
EXPECT_EQ(line, without_column.GetLine().value_or(0));
- EXPECT_EQ(llvm::None, without_column.GetColumn());
+ EXPECT_EQ(std::nullopt, without_column.GetColumn());
EXPECT_FALSE(without_column.GetCheckInlines());
EXPECT_TRUE(without_column.GetExactMatch());
EXPECT_STREQ("check inlines = false, exact match = true, decl = /foo/bar:19",
endian::InlHostByteOrder(), sizeof(void *)));
const bool success = StringPrinter::ReadBufferAndDumpToStream<elem_ty>(opts);
if (!success)
- return llvm::None;
+ return std::nullopt;
return out.GetString().str();
}
CreateDomainConnectedSockets(domain_path, &socket_a_up, &socket_b_up);
std::string uri(socket_a_up->GetRemoteConnectionURI());
- EXPECT_EQ((URI{"unix-connect", "", llvm::None, domain_path}),
+ EXPECT_EQ((URI{"unix-connect", "", std::nullopt, domain_path}),
URI::Parse(uri));
EXPECT_EQ(socket_b_up->GetRemoteConnectionURI(), "");
EXPECT_EQ(Record::StackWin, Record::classify("STACK WIN"));
// Any obviously incorrect lines will be classified as such.
- EXPECT_EQ(llvm::None, Record::classify("STACK"));
- EXPECT_EQ(llvm::None, Record::classify("STACK CODE_ID"));
- EXPECT_EQ(llvm::None, Record::classify("CODE_ID"));
+ EXPECT_EQ(std::nullopt, Record::classify("STACK"));
+ EXPECT_EQ(std::nullopt, Record::classify("STACK CODE_ID"));
+ EXPECT_EQ(std::nullopt, Record::classify("CODE_ID"));
// Any line which does not start with a known keyword will be classified as a
// line record, as those are the only ones that start without a keyword.
ModuleRecord::parse(
"MODULE Linux x86_64 404142434445464748494a4b4c4d4e4f0 a.out"));
- EXPECT_EQ(llvm::None, ModuleRecord::parse("MODULE"));
- EXPECT_EQ(llvm::None, ModuleRecord::parse("MODULE Linux"));
- EXPECT_EQ(llvm::None, ModuleRecord::parse("MODULE Linux x86_64"));
- EXPECT_EQ(llvm::None,
+ EXPECT_EQ(std::nullopt, ModuleRecord::parse("MODULE"));
+ EXPECT_EQ(std::nullopt, ModuleRecord::parse("MODULE Linux"));
+ EXPECT_EQ(std::nullopt, ModuleRecord::parse("MODULE Linux x86_64"));
+ EXPECT_EQ(std::nullopt,
ModuleRecord::parse("MODULE Linux x86_64 deadbeefbaadf00d"));
}
InfoRecord::parse("INFO CODE_ID 404142434445464748494a4b4c4d4e4f"));
EXPECT_EQ(InfoRecord(UUID()), InfoRecord::parse("INFO CODE_ID 47 a.exe"));
- EXPECT_EQ(llvm::None, InfoRecord::parse("INFO"));
- EXPECT_EQ(llvm::None, InfoRecord::parse("INFO CODE_ID"));
+ EXPECT_EQ(std::nullopt, InfoRecord::parse("INFO"));
+ EXPECT_EQ(std::nullopt, InfoRecord::parse("INFO CODE_ID"));
}
TEST(FileRecord, parse) {
EXPECT_EQ(FileRecord(47, "foo"), FileRecord::parse("FILE 47 foo"));
- EXPECT_EQ(llvm::None, FileRecord::parse("FILE 47"));
- EXPECT_EQ(llvm::None, FileRecord::parse("FILE"));
- EXPECT_EQ(llvm::None, FileRecord::parse(""));
+ EXPECT_EQ(std::nullopt, FileRecord::parse("FILE 47"));
+ EXPECT_EQ(std::nullopt, FileRecord::parse("FILE"));
+ EXPECT_EQ(std::nullopt, FileRecord::parse(""));
}
TEST(FuncRecord, parse) {
EXPECT_EQ(FuncRecord(false, 0x47, 0x7, 0x8, "foo"),
FuncRecord::parse("FUNC 47 7 8 foo"));
- EXPECT_EQ(llvm::None, FuncRecord::parse("PUBLIC 47 7 8 foo"));
- EXPECT_EQ(llvm::None, FuncRecord::parse("FUNC 47 7 8"));
- EXPECT_EQ(llvm::None, FuncRecord::parse("FUNC 47 7"));
- EXPECT_EQ(llvm::None, FuncRecord::parse("FUNC 47"));
- EXPECT_EQ(llvm::None, FuncRecord::parse("FUNC m"));
- EXPECT_EQ(llvm::None, FuncRecord::parse("FUNC"));
+ EXPECT_EQ(std::nullopt, FuncRecord::parse("PUBLIC 47 7 8 foo"));
+ EXPECT_EQ(std::nullopt, FuncRecord::parse("FUNC 47 7 8"));
+ EXPECT_EQ(std::nullopt, FuncRecord::parse("FUNC 47 7"));
+ EXPECT_EQ(std::nullopt, FuncRecord::parse("FUNC 47"));
+ EXPECT_EQ(std::nullopt, FuncRecord::parse("FUNC m"));
+ EXPECT_EQ(std::nullopt, FuncRecord::parse("FUNC"));
}
TEST(InlineOriginRecord, parse) {
EXPECT_EQ(InlineOriginRecord(47, "foo"),
InlineOriginRecord::parse("INLINE_ORIGIN 47 foo"));
- EXPECT_EQ(llvm::None, InlineOriginRecord::parse("INLINE_ORIGIN 47"));
- EXPECT_EQ(llvm::None, InlineOriginRecord::parse("INLINE_ORIGIN"));
- EXPECT_EQ(llvm::None, InlineOriginRecord::parse(""));
+ EXPECT_EQ(std::nullopt, InlineOriginRecord::parse("INLINE_ORIGIN 47"));
+ EXPECT_EQ(std::nullopt, InlineOriginRecord::parse("INLINE_ORIGIN"));
+ EXPECT_EQ(std::nullopt, InlineOriginRecord::parse(""));
}
TEST(InlineRecord, parse) {
EXPECT_EQ(record1, InlineRecord::parse("INLINE 0 1 2 3 4 5"));
record1.Ranges.emplace_back(6, 7);
EXPECT_EQ(record1, InlineRecord::parse("INLINE 0 1 2 3 4 5 6 7"));
- EXPECT_EQ(llvm::None, InlineRecord::parse("INLINE 0 1 2 3"));
- EXPECT_EQ(llvm::None, InlineRecord::parse("INLINE 0 1 2 3 4 5 6"));
- EXPECT_EQ(llvm::None, InlineRecord::parse("INLNIE 0"));
- EXPECT_EQ(llvm::None, InlineRecord::parse(""));
- EXPECT_EQ(llvm::None, InlineRecord::parse("FUNC"));
+ EXPECT_EQ(std::nullopt, InlineRecord::parse("INLINE 0 1 2 3"));
+ EXPECT_EQ(std::nullopt, InlineRecord::parse("INLINE 0 1 2 3 4 5 6"));
+ EXPECT_EQ(std::nullopt, InlineRecord::parse("INLNIE 0"));
+ EXPECT_EQ(std::nullopt, InlineRecord::parse(""));
+ EXPECT_EQ(std::nullopt, InlineRecord::parse("FUNC"));
}
TEST(LineRecord, parse) {
EXPECT_EQ(LineRecord(0x47, 0x74, 47, 74), LineRecord::parse("47 74 47 74"));
- EXPECT_EQ(llvm::None, LineRecord::parse("47 74 47"));
- EXPECT_EQ(llvm::None, LineRecord::parse("47 74"));
- EXPECT_EQ(llvm::None, LineRecord::parse("47"));
- EXPECT_EQ(llvm::None, LineRecord::parse(""));
- EXPECT_EQ(llvm::None, LineRecord::parse("FUNC"));
+ EXPECT_EQ(std::nullopt, LineRecord::parse("47 74 47"));
+ EXPECT_EQ(std::nullopt, LineRecord::parse("47 74"));
+ EXPECT_EQ(std::nullopt, LineRecord::parse("47"));
+ EXPECT_EQ(std::nullopt, LineRecord::parse(""));
+ EXPECT_EQ(std::nullopt, LineRecord::parse("FUNC"));
}
TEST(PublicRecord, parse) {
EXPECT_EQ(PublicRecord(false, 0x47, 0x8, "foo"),
PublicRecord::parse("PUBLIC 47 8 foo"));
- EXPECT_EQ(llvm::None, PublicRecord::parse("FUNC 47 8 foo"));
- EXPECT_EQ(llvm::None, PublicRecord::parse("PUBLIC 47 8"));
- EXPECT_EQ(llvm::None, PublicRecord::parse("PUBLIC 47"));
- EXPECT_EQ(llvm::None, PublicRecord::parse("PUBLIC m"));
- EXPECT_EQ(llvm::None, PublicRecord::parse("PUBLIC"));
+ EXPECT_EQ(std::nullopt, PublicRecord::parse("FUNC 47 8 foo"));
+ EXPECT_EQ(std::nullopt, PublicRecord::parse("PUBLIC 47 8"));
+ EXPECT_EQ(std::nullopt, PublicRecord::parse("PUBLIC 47"));
+ EXPECT_EQ(std::nullopt, PublicRecord::parse("PUBLIC m"));
+ EXPECT_EQ(std::nullopt, PublicRecord::parse("PUBLIC"));
}
TEST(StackCFIRecord, parse) {
EXPECT_EQ(StackCFIRecord(0x47, 0x8, ".cfa: $esp 4 +"),
StackCFIRecord::parse("STACK CFI INIT 47 8 .cfa: $esp 4 + "));
- EXPECT_EQ(StackCFIRecord(0x47, llvm::None, ".cfa: $esp 4 +"),
+ EXPECT_EQ(StackCFIRecord(0x47, std::nullopt, ".cfa: $esp 4 +"),
StackCFIRecord::parse("STACK CFI 47 .cfa: $esp 4 +"));
// The validity of the register value expressions is not checked
EXPECT_EQ(StackCFIRecord(0x47, 0x8, ".cfa: ^ ^ ^"),
StackCFIRecord::parse("STACK CFI INIT 47 8 .cfa: ^ ^ ^"));
- EXPECT_EQ(llvm::None, StackCFIRecord::parse("STACK CFI INIT 47"));
- EXPECT_EQ(llvm::None, StackCFIRecord::parse("STACK CFI INIT"));
- EXPECT_EQ(llvm::None, StackCFIRecord::parse("STACK CFI"));
- EXPECT_EQ(llvm::None, StackCFIRecord::parse("STACK"));
- EXPECT_EQ(llvm::None, StackCFIRecord::parse("FILE 47 foo"));
- EXPECT_EQ(llvm::None, StackCFIRecord::parse("42 47"));
+ EXPECT_EQ(std::nullopt, StackCFIRecord::parse("STACK CFI INIT 47"));
+ EXPECT_EQ(std::nullopt, StackCFIRecord::parse("STACK CFI INIT"));
+ EXPECT_EQ(std::nullopt, StackCFIRecord::parse("STACK CFI"));
+ EXPECT_EQ(std::nullopt, StackCFIRecord::parse("STACK"));
+ EXPECT_EQ(std::nullopt, StackCFIRecord::parse("FILE 47 foo"));
+ EXPECT_EQ(std::nullopt, StackCFIRecord::parse("42 47"));
}
TEST(StackWinRecord, parse) {
StackWinRecord(0x47, 0x8, 3, 4, 5, llvm::StringRef("$eip $esp ^ =")),
StackWinRecord::parse("STACK WIN 4 47 8 1 2 3 4 5 6 1 $eip $esp ^ ="));
- EXPECT_EQ(llvm::None, StackWinRecord::parse(
- "STACK WIN 0 47 8 1 0 0 0 0 0 1 $eip $esp ^ ="));
- EXPECT_EQ(llvm::None,
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse(
+ "STACK WIN 0 47 8 1 0 0 0 0 0 1 $eip $esp ^ ="));
+ EXPECT_EQ(std::nullopt,
StackWinRecord::parse("STACK WIN 4 47 8 1 0 0 0 0 0 0 1"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse(
- "STACK WIN 3 47 8 1 0 0 0 0 0 1 $eip $esp ^ ="));
- EXPECT_EQ(llvm::None,
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse(
+ "STACK WIN 3 47 8 1 0 0 0 0 0 1 $eip $esp ^ ="));
+ EXPECT_EQ(std::nullopt,
StackWinRecord::parse("STACK WIN 3 47 8 1 0 0 0 0 0 0 1"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse(
- "STACK WIN 4 47 8 1 0 0 0 0 1 $eip $esp ^ ="));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN 4 47 8 1 0 0 0 0 0"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN 4 47 8 1 0 0 0 0"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN 4 47 8 1 0 0 0"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN 4 47 8 1 0 0"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN 4 47 8 1 0"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN 4 47 8 1"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN 4 47 8"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN 4 47"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN 4"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK WIN"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse("STACK"));
- EXPECT_EQ(llvm::None, StackWinRecord::parse(""));
- EXPECT_EQ(llvm::None, StackCFIRecord::parse("FILE 47 foo"));
- EXPECT_EQ(llvm::None, StackCFIRecord::parse("42 47"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse(
+ "STACK WIN 4 47 8 1 0 0 0 0 1 $eip $esp ^ ="));
+ EXPECT_EQ(std::nullopt,
+ StackWinRecord::parse("STACK WIN 4 47 8 1 0 0 0 0 0"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK WIN 4 47 8 1 0 0 0 0"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK WIN 4 47 8 1 0 0 0"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK WIN 4 47 8 1 0 0"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK WIN 4 47 8 1 0"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK WIN 4 47 8 1"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK WIN 4 47 8"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK WIN 4 47"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK WIN 4"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK WIN"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse("STACK"));
+ EXPECT_EQ(std::nullopt, StackWinRecord::parse(""));
+ EXPECT_EQ(std::nullopt, StackCFIRecord::parse("FILE 47 foo"));
+ EXPECT_EQ(std::nullopt, StackCFIRecord::parse("42 47"));
}
void WaitForRunEvent() {
EventSP event_sp;
listener_sp->GetEventForBroadcasterWithType(
- &client, TestClient::eBroadcastBitRunPacketSent, event_sp, llvm::None);
+ &client, TestClient::eBroadcastBitRunPacketSent, event_sp,
+ std::nullopt);
}
};
EXPECT_EQ((QOffsets{true, {0x1234, 0x2345}}),
GetQOffsets("TextSeg=1234;DataSeg=2345"));
- EXPECT_EQ(llvm::None, GetQOffsets("E05"));
- EXPECT_EQ(llvm::None, GetQOffsets("Text=bogus"));
- EXPECT_EQ(llvm::None, GetQOffsets("Text=1234"));
- EXPECT_EQ(llvm::None, GetQOffsets("Text=1234;Data=1234;"));
- EXPECT_EQ(llvm::None, GetQOffsets("Text=1234;Data=1234;Bss=1234;"));
- EXPECT_EQ(llvm::None, GetQOffsets("TEXTSEG=1234"));
- EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=0x1234"));
- EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=12345678123456789"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("E05"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("Text=bogus"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("Text=1234"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("Text=1234;Data=1234;"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("Text=1234;Data=1234;Bss=1234;"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("TEXTSEG=1234"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("TextSeg=0x1234"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("TextSeg=12345678123456789"));
}
static void
std::vector<uint8_t>{0x1, 0x2});
// Empty response is an error
- check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "", llvm::None);
+ check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "", std::nullopt);
// Usual error response
check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "E01",
- llvm::None);
+ std::nullopt);
// Leading m missing
- check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "01", llvm::None);
+ check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "01",
+ std::nullopt);
// Anything other than m is an error
check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "z01",
- llvm::None);
+ std::nullopt);
// Decoding tag data doesn't use all the chars in the packet
check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "m09zz",
- llvm::None);
+ std::nullopt);
// Data that is not hex bytes
check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "mhello",
- llvm::None);
+ std::nullopt);
// Data is not a complete hex char
- check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "m9", llvm::None);
+ check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "m9",
+ std::nullopt);
// Data has a trailing hex char
check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "m01020",
- llvm::None);
+ std::nullopt);
}
static void check_Qmemtags(TestClient &client, MockServer &server,
...
)"),
llvm::Succeeded());
- EXPECT_EQ(llvm::None, parser->FindMemoryRange(0x00));
- EXPECT_EQ(llvm::None, parser->FindMemoryRange(0x2a));
+ EXPECT_EQ(std::nullopt, parser->FindMemoryRange(0x00));
+ EXPECT_EQ(std::nullopt, parser->FindMemoryRange(0x2a));
EXPECT_EQ((minidump::Range{0x401d46, llvm::ArrayRef<uint8_t>{0x54, 0x21}}),
parser->FindMemoryRange(0x401d46));
- EXPECT_EQ(llvm::None, parser->FindMemoryRange(0x401d46 + 2));
+ EXPECT_EQ(std::nullopt, parser->FindMemoryRange(0x401d46 + 2));
EXPECT_EQ(
(minidump::Range{0x7ffceb34a000,
llvm::ArrayRef<uint8_t>{0xc8, 0x4d, 0x04, 0xbc, 0xe9}}),
parser->FindMemoryRange(0x7ffceb34a000 + 2));
- EXPECT_EQ(llvm::None, parser->FindMemoryRange(0x7ffceb34a000 + 5));
+ EXPECT_EQ(std::nullopt, parser->FindMemoryRange(0x7ffceb34a000 + 5));
}
TEST_F(MinidumpParserTest, GetMemory) {
...
)"),
llvm::Succeeded());
- EXPECT_EQ(llvm::None, parser->GetLinuxProcStatus());
+ EXPECT_EQ(std::nullopt, parser->GetLinuxProcStatus());
}
TEST_F(MinidumpParserTest, GetMiscInfoWindows) {
llvm::Optional<std::string> lldb_private::LLDBSWIGPythonRunScriptKeywordThread(
const char *python_function_name, const char *session_dictionary_name,
lldb::ThreadSP thread) {
- return llvm::None;
+ return std::nullopt;
}
bool lldb_private::LLDBSWIGPythonRunScriptKeywordTarget(
llvm::Optional<std::string> lldb_private::LLDBSWIGPythonRunScriptKeywordFrame(
const char *python_function_name, const char *session_dictionary_name,
lldb::StackFrameSP frame) {
- return llvm::None;
+ return std::nullopt;
}
bool lldb_private::LLDBSWIGPythonRunScriptKeywordValue(
TEST(UnixSignalsTest, GetFilteredSignals) {
TestSignals signals;
- auto all_signals = signals.GetFilteredSignals(None, None, None);
+ auto all_signals =
+ signals.GetFilteredSignals(std::nullopt, std::nullopt, std::nullopt);
std::vector<int32_t> expected = {2, 4, 8, 16};
EXPECT_EQ_ARRAYS(expected, all_signals);
- auto supressed = signals.GetFilteredSignals(true, None, None);
+ auto supressed = signals.GetFilteredSignals(true, std::nullopt, std::nullopt);
expected = {4, 8, 16};
EXPECT_EQ_ARRAYS(expected, supressed);
- auto not_supressed = signals.GetFilteredSignals(false, None, None);
+ auto not_supressed =
+ signals.GetFilteredSignals(false, std::nullopt, std::nullopt);
expected = {2};
EXPECT_EQ_ARRAYS(expected, not_supressed);
- auto stopped = signals.GetFilteredSignals(None, true, None);
+ auto stopped = signals.GetFilteredSignals(std::nullopt, true, std::nullopt);
expected = {2, 8};
EXPECT_EQ_ARRAYS(expected, stopped);
- auto not_stopped = signals.GetFilteredSignals(None, false, None);
+ auto not_stopped =
+ signals.GetFilteredSignals(std::nullopt, false, std::nullopt);
expected = {4, 16};
EXPECT_EQ_ARRAYS(expected, not_stopped);
- auto notified = signals.GetFilteredSignals(None, None, true);
+ auto notified = signals.GetFilteredSignals(std::nullopt, std::nullopt, true);
expected = {2, 4, 8};
EXPECT_EQ_ARRAYS(expected, notified);
- auto not_notified = signals.GetFilteredSignals(None, None, false);
+ auto not_notified =
+ signals.GetFilteredSignals(std::nullopt, std::nullopt, false);
expected = {16};
EXPECT_EQ_ARRAYS(expected, not_notified);
// TODO: Handle SourceLocationSpec column information
llvm::Expected<SymbolContextList> LineEntryTest::GetLineEntriesForLine(
- uint32_t line, llvm::Optional<uint16_t> column = llvm::None) {
+ uint32_t line, llvm::Optional<uint16_t> column = std::nullopt) {
SymbolContextList sc_comp_units;
SymbolContextList sc_line_entries;
FileSpec file_spec("inlined-functions.cpp");
EXPECT_EQ(
m_ast->GetTypeTemplateArgument(t.GetOpaqueQualType(), 0, expand_pack),
int_type);
- EXPECT_EQ(llvm::None, m_ast->GetIntegralTemplateArgument(
- t.GetOpaqueQualType(), 0, expand_pack));
+ EXPECT_EQ(std::nullopt, m_ast->GetIntegralTemplateArgument(
+ t.GetOpaqueQualType(), 0, expand_pack));
EXPECT_EQ(
m_ast->GetTemplateArgumentKind(t.GetOpaqueQualType(), 1, expand_pack),
CompilerType());
auto result = m_ast->GetIntegralTemplateArgument(t.GetOpaqueQualType(), 1,
expand_pack);
- ASSERT_NE(llvm::None, result);
+ ASSERT_NE(std::nullopt, result);
EXPECT_EQ(arg, result->value);
EXPECT_EQ(int_type, result->type);
}
TEST_F(TestTypeSystemClang, GetExeModuleWhenMissingSymbolFile) {
CompilerType compiler_type = m_ast->GetBasicTypeFromAST(lldb::eBasicTypeInt);
- lldb_private::Type t(0, nullptr, ConstString("MyType"), llvm::None, nullptr,
+ lldb_private::Type t(0, nullptr, ConstString("MyType"), std::nullopt, nullptr,
0, {}, {}, compiler_type,
lldb_private::Type::ResolveState::Full);
// Test that getting the execution module when no type system is present
TEST(DWARFIndexCachingTest, DIERefEncodeDecode) {
// Tests DIERef::Encode(...) and DIERef::Decode(...)
- EncodeDecode(DIERef(llvm::None, DIERef::Section::DebugInfo, 0x11223344));
- EncodeDecode(DIERef(llvm::None, DIERef::Section::DebugTypes, 0x11223344));
+ EncodeDecode(DIERef(std::nullopt, DIERef::Section::DebugInfo, 0x11223344));
+ EncodeDecode(DIERef(std::nullopt, DIERef::Section::DebugTypes, 0x11223344));
EncodeDecode(DIERef(100, DIERef::Section::DebugInfo, 0x11223344));
EncodeDecode(DIERef(200, DIERef::Section::DebugTypes, 0x11223344));
}
// Make sure an empty NameToDIE map encodes and decodes correctly.
EncodeDecode(map);
map.Insert(ConstString("hello"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, 0x11223344));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, 0x11223344));
map.Insert(ConstString("workd"),
DIERef(100, DIERef::Section::DebugInfo, 0x11223344));
map.Finalize();
// be encoded and decoded correctly.
set.function_basenames.Insert(
ConstString("a"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
EncodeDecode(set);
set.function_basenames.Clear();
// Make sure an IndexSet with only items in IndexSet::function_fullnames can
// be encoded and decoded correctly.
set.function_fullnames.Insert(
ConstString("a"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
EncodeDecode(set);
set.function_fullnames.Clear();
// Make sure an IndexSet with only items in IndexSet::function_methods can
// be encoded and decoded correctly.
set.function_methods.Insert(
ConstString("a"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
EncodeDecode(set);
set.function_methods.Clear();
// Make sure an IndexSet with only items in IndexSet::function_selectors can
// be encoded and decoded correctly.
set.function_selectors.Insert(
ConstString("a"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
EncodeDecode(set);
set.function_selectors.Clear();
// Make sure an IndexSet with only items in IndexSet::objc_class_selectors can
// be encoded and decoded correctly.
set.objc_class_selectors.Insert(
ConstString("a"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
EncodeDecode(set);
set.objc_class_selectors.Clear();
// Make sure an IndexSet with only items in IndexSet::globals can
// be encoded and decoded correctly.
set.globals.Insert(
ConstString("a"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
EncodeDecode(set);
set.globals.Clear();
// Make sure an IndexSet with only items in IndexSet::types can
// be encoded and decoded correctly.
set.types.Insert(
ConstString("a"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
EncodeDecode(set);
set.types.Clear();
// Make sure an IndexSet with only items in IndexSet::namespaces can
// be encoded and decoded correctly.
set.namespaces.Insert(
ConstString("a"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
EncodeDecode(set);
set.namespaces.Clear();
// Make sure that an IndexSet with item in all NameToDIE maps can be
// be encoded and decoded correctly.
set.function_basenames.Insert(
ConstString("a"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
set.function_fullnames.Insert(
ConstString("b"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
set.function_methods.Insert(
ConstString("c"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
set.function_selectors.Insert(
ConstString("d"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
set.objc_class_selectors.Insert(
ConstString("e"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
set.globals.Insert(
ConstString("f"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
set.types.Insert(
ConstString("g"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
set.namespaces.Insert(
ConstString("h"),
- DIERef(llvm::None, DIERef::Section::DebugInfo, ++die_offset));
+ DIERef(std::nullopt, DIERef::Section::DebugInfo, ++die_offset));
EncodeDecode(set);
}
sig.m_obj_mod_time = 0x456789ab;
EXPECT_TRUE(sig.IsValid());
EncodeDecode(sig, /*encode_result=*/true);
- sig.m_mod_time = llvm::None;
+ sig.m_mod_time = std::nullopt;
EXPECT_TRUE(sig.IsValid());
EncodeDecode(sig, /*encode_result=*/true);
// Last granule of the range is not tagged
EXPECT_THAT(tag_map.GetTags(0, 48),
- ::testing::ContainerEq(TagsVec{0, 1, llvm::None}));
+ ::testing::ContainerEq(TagsVec{0, 1, std::nullopt}));
EXPECT_THAT(tag_map.GetTags(16, 32),
- ::testing::ContainerEq(TagsVec{1, llvm::None}));
+ ::testing::ContainerEq(TagsVec{1, std::nullopt}));
// Reading beyond that address gives you no tags at all
EXPECT_THAT(tag_map.GetTags(32, 16), ::testing::ContainerEq(TagsVec{}));
// Here the length pushes the range into the next granule. When aligned
// this produces 2 granules.
EXPECT_THAT(tag_map.GetTags(30, 4),
- ::testing::ContainerEq(TagsVec{1, llvm::None}));
+ ::testing::ContainerEq(TagsVec{1, std::nullopt}));
// A range can also have gaps at the beginning or in the middle.
// Add more tags, 1 granule away from the first range.
// Untagged first granule
EXPECT_THAT(tag_map.GetTags(32, 32),
- ::testing::ContainerEq(TagsVec{llvm::None, 3}));
+ ::testing::ContainerEq(TagsVec{std::nullopt, 3}));
// Untagged middle granule
EXPECT_THAT(tag_map.GetTags(16, 48),
- ::testing::ContainerEq(TagsVec{1, llvm::None, 3}));
+ ::testing::ContainerEq(TagsVec{1, std::nullopt, 3}));
}
FileSpec::GuessPathStyle(R"(\\net\foo.txt)"));
EXPECT_EQ(FileSpec::Style::windows, FileSpec::GuessPathStyle(R"(Z:\)"));
EXPECT_EQ(FileSpec::Style::windows, FileSpec::GuessPathStyle(R"(Z:/)"));
- EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("foo.txt"));
- EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("foo/bar.txt"));
- EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("Z:"));
+ EXPECT_EQ(std::nullopt, FileSpec::GuessPathStyle("foo.txt"));
+ EXPECT_EQ(std::nullopt, FileSpec::GuessPathStyle("foo/bar.txt"));
+ EXPECT_EQ(std::nullopt, FileSpec::GuessPathStyle("Z:"));
}
TEST(FileSpecTest, GetPath) {
// broadcast sends.
std::future<void> async_broadcast =
std::async(std::launch::async, delayed_broadcast);
- EXPECT_TRUE(listener_sp->GetEvent(event_sp, llvm::None));
+ EXPECT_TRUE(listener_sp->GetEvent(event_sp, std::nullopt));
async_broadcast.get();
async_broadcast = std::async(std::launch::async, delayed_broadcast);
- EXPECT_TRUE(
- listener_sp->GetEventForBroadcaster(&broadcaster, event_sp, llvm::None));
+ EXPECT_TRUE(listener_sp->GetEventForBroadcaster(&broadcaster, event_sp,
+ std::nullopt));
async_broadcast.get();
async_broadcast = std::async(std::launch::async, delayed_broadcast);
EXPECT_TRUE(listener_sp->GetEventForBroadcasterWithType(
- &broadcaster, event_mask, event_sp, llvm::None));
+ &broadcaster, event_mask, event_sp, std::nullopt));
async_broadcast.get();
}
TEST(Predicate, WaitForValueNotEqualTo) {
Predicate<int> P(0);
EXPECT_EQ(0, P.WaitForValueNotEqualTo(1));
- EXPECT_EQ(llvm::None,
+ EXPECT_EQ(std::nullopt,
P.WaitForValueNotEqualTo(0, std::chrono::milliseconds(10)));
}
llvm::Optional<std::string> DoGetUserName(id_t uid) override {
if (uid % 2)
return ("user" + llvm::Twine(uid)).str();
- return llvm::None;
+ return std::nullopt;
}
llvm::Optional<std::string> DoGetGroupName(id_t gid) override {
if (gid % 2)
return ("group" + llvm::Twine(gid)).str();
- return llvm::None;
+ return std::nullopt;
}
};
} // namespace
Scalar S;
if (V.GetScalarValue(S))
return S;
- return llvm::None;
+ return std::nullopt;
};
EXPECT_EQ(Get(RV(uint8_t(47))), Scalar(47));
EXPECT_EQ(Get(RV(uint16_t(4747))), Scalar(4747));
TEST(StringExtractorGDBRemoteTest, GetPidTid) {
StringExtractorGDBRemote ex("");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
// invalid/short values
ex.Reset("narf");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset(";1234");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset(".1234");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("pnarf");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p;1234");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p.1234");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p1234.");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p1234.;1234");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("-2");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p1234.-2");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p-2");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p-2.1234");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
// overflow
ex.Reset("p10000000000000000");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p10000000000000000.0");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("10000000000000000");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p0.10000000000000000");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
ex.Reset("p10000000000000000.10000000000000000");
- EXPECT_EQ(ex.GetPidTid(0), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(0), std::nullopt);
// invalid: all processes but specific thread
ex.Reset("p-1.0");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
ex.Reset("p-1.1234");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
ex.Reset("p-1.123456789ABCDEF0");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
// unsupported: pid/tid 0
ex.Reset("0");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
ex.Reset("p0");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
ex.Reset("p0.0");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
ex.Reset("p0.-1");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
ex.Reset("p0.1234");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
ex.Reset("p0.123456789ABCDEF0");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
ex.Reset("p1234.0");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
ex.Reset("p123456789ABCDEF0.0");
- EXPECT_EQ(ex.GetPidTid(100), llvm::None);
+ EXPECT_EQ(ex.GetPidTid(100), std::nullopt);
// pure thread id
using namespace std::chrono;
TEST(TimeoutTest, Construction) {
- EXPECT_FALSE(Timeout<std::micro>(llvm::None));
+ EXPECT_FALSE(Timeout<std::micro>(std::nullopt));
EXPECT_TRUE(bool(Timeout<std::micro>(seconds(0))));
EXPECT_EQ(seconds(0), *Timeout<std::micro>(seconds(0)));
EXPECT_EQ(seconds(3), *Timeout<std::micro>(seconds(3)));
TEST(TimeoutTest, Format) {
EXPECT_EQ("<infinite>",
- llvm::formatv("{0}", Timeout<std::milli>(llvm::None)).str());
+ llvm::formatv("{0}", Timeout<std::milli>(std::nullopt)).str());
EXPECT_EQ("1000 ms",
llvm::formatv("{0}", Timeout<std::milli>(seconds(1))).str());
}
using namespace lldb_private;
TEST(UriParserTest, Minimal) {
- EXPECT_EQ((URI{"x", "y", llvm::None, "/"}), URI::Parse("x://y"));
+ EXPECT_EQ((URI{"x", "y", std::nullopt, "/"}), URI::Parse("x://y"));
}
TEST(UriParserTest, MinimalPort) {
}
TEST(UriParserTest, MinimalPath) {
- EXPECT_EQ((URI{"x", "y", llvm::None, "/"}), URI::Parse("x://y/"));
+ EXPECT_EQ((URI{"x", "y", std::nullopt, "/"}), URI::Parse("x://y/"));
}
TEST(UriParserTest, MinimalPortPath) {
}
TEST(UriParserTest, LongPath) {
- EXPECT_EQ((URI{"x", "y", llvm::None, "/abc/def/xyz"}),
+ EXPECT_EQ((URI{"x", "y", std::nullopt, "/abc/def/xyz"}),
URI::Parse("x://y/abc/def/xyz"));
}
}
TEST(UriParserTest, BracketedHostname) {
- EXPECT_EQ((URI{"connect", "192.168.100.132", llvm::None, "/"}),
+ EXPECT_EQ((URI{"connect", "192.168.100.132", std::nullopt, "/"}),
URI::Parse("connect://[192.168.100.132]"));
}
TEST(UriParserTest, BracketedHostnameWithPortIPv4) {
// Android device over IPv4: port is a part of the hostname.
- EXPECT_EQ((URI{"connect", "192.168.100.132:1234", llvm::None, "/"}),
+ EXPECT_EQ((URI{"connect", "192.168.100.132:1234", std::nullopt, "/"}),
URI::Parse("connect://[192.168.100.132:1234]"));
}
TEST(UriParserTest, BracketedHostnameWithPortIPv6) {
// Android device over IPv6: port is a part of the hostname.
EXPECT_EQ((URI{"connect", "[2601:600:107f:db64:a42b:4faa:284]:1234",
- llvm::None, "/"}),
+ std::nullopt, "/"}),
URI::Parse("connect://[[2601:600:107f:db64:a42b:4faa:284]:1234]"));
}
}
TEST(UriParserTest, SchemeHostSeparator) {
- EXPECT_EQ(llvm::None, URI::Parse("x:/y"));
+ EXPECT_EQ(std::nullopt, URI::Parse("x:/y"));
}
TEST(UriParserTest, SchemeHostSeparator2) {
- EXPECT_EQ(llvm::None, URI::Parse("x:y"));
+ EXPECT_EQ(std::nullopt, URI::Parse("x:y"));
}
TEST(UriParserTest, SchemeHostSeparator3) {
- EXPECT_EQ(llvm::None, URI::Parse("x//y"));
+ EXPECT_EQ(std::nullopt, URI::Parse("x//y"));
}
TEST(UriParserTest, SchemeHostSeparator4) {
- EXPECT_EQ(llvm::None, URI::Parse("x/y"));
+ EXPECT_EQ(std::nullopt, URI::Parse("x/y"));
}
-TEST(UriParserTest, BadPort) { EXPECT_EQ(llvm::None, URI::Parse("x://y:a/")); }
+TEST(UriParserTest, BadPort) {
+ EXPECT_EQ(std::nullopt, URI::Parse("x://y:a/"));
+}
TEST(UriParserTest, BadPort2) {
- EXPECT_EQ(llvm::None, URI::Parse("x://y:5432a/"));
+ EXPECT_EQ(std::nullopt, URI::Parse("x://y:5432a/"));
}
-TEST(UriParserTest, Empty) { EXPECT_EQ(llvm::None, URI::Parse("")); }
+TEST(UriParserTest, Empty) { EXPECT_EQ(std::nullopt, URI::Parse("")); }
TEST(UriParserTest, PortOverflow) {
- EXPECT_EQ(llvm::None,
+ EXPECT_EQ(std::nullopt,
URI::Parse("x://"
"y:"
"0123456789012345678901234567890123456789012345678"
StrictMock<TestUserIDResolver> r;
llvm::StringRef user47("foo");
EXPECT_CALL(r, DoGetUserName(47)).Times(1).WillOnce(Return(user47.str()));
- EXPECT_CALL(r, DoGetUserName(42)).Times(1).WillOnce(Return(llvm::None));
+ EXPECT_CALL(r, DoGetUserName(42)).Times(1).WillOnce(Return(std::nullopt));
// Call functions twice to make sure the caching works.
EXPECT_EQ(user47, r.GetUserName(47));
EXPECT_EQ(user47, r.GetUserName(47));
- EXPECT_EQ(llvm::None, r.GetUserName(42));
- EXPECT_EQ(llvm::None, r.GetUserName(42));
+ EXPECT_EQ(std::nullopt, r.GetUserName(42));
+ EXPECT_EQ(std::nullopt, r.GetUserName(42));
}
TEST(UserIDResolver, GetGroupName) {
StrictMock<TestUserIDResolver> r;
llvm::StringRef group47("foo");
EXPECT_CALL(r, DoGetGroupName(47)).Times(1).WillOnce(Return(group47.str()));
- EXPECT_CALL(r, DoGetGroupName(42)).Times(1).WillOnce(Return(llvm::None));
+ EXPECT_CALL(r, DoGetGroupName(42)).Times(1).WillOnce(Return(std::nullopt));
// Call functions twice to make sure the caching works.
EXPECT_EQ(group47, r.GetGroupName(47));
EXPECT_EQ(group47, r.GetGroupName(47));
- EXPECT_EQ(llvm::None, r.GetGroupName(42));
- EXPECT_EQ(llvm::None, r.GetGroupName(42));
+ EXPECT_EQ(std::nullopt, r.GetGroupName(42));
+ EXPECT_EQ(std::nullopt, r.GetGroupName(42));
}
}
Error TestClient::qProcessInfo() {
- m_process_info = None;
+ m_process_info = std::nullopt;
auto InfoOr = SendMessage<ProcessInfo>("qProcessInfo");
if (!InfoOr)
return InfoOr.takeError();