Skip to content

Commit edd781d

Browse files
committed
fixup! no need for std::optional
(cherry picked from commit 7aeed0f)
1 parent fa0b004 commit edd781d

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ static unsigned GetCXXMethodCVQuals(const DWARFDIE &subprogram,
250250
return cv_quals;
251251
}
252252

253-
static std::optional<std::string> MakeLLDBFuncAsmLabel(const DWARFDIE &die) {
253+
static std::string MakeLLDBFuncAsmLabel(const DWARFDIE &die) {
254254
char const *name = die.GetMangledName(/*substitute_name_allowed*/ false);
255255
if (!name)
256-
return std::nullopt;
256+
return {};
257257

258258
SymbolFileDWARF *dwarf = die.GetDWARF();
259259
if (!dwarf)
260-
return std::nullopt;
260+
return {};
261261

262262
auto get_module_id = [&](SymbolFile *sym) {
263263
if (!sym)
@@ -279,11 +279,11 @@ static std::optional<std::string> MakeLLDBFuncAsmLabel(const DWARFDIE &die) {
279279
module_id = get_module_id(dwarf);
280280

281281
if (module_id == LLDB_INVALID_UID)
282-
return std::nullopt;
282+
return {};
283283

284284
const auto die_id = die.GetID();
285285
if (die_id == LLDB_INVALID_UID)
286-
return std::nullopt;
286+
return {};
287287

288288
return FunctionCallLabel{/*module_id=*/module_id,
289289
/*symbol_id=*/die_id,

lldb/unittests/Symbol/TestTypeSystemClang.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -869,11 +869,7 @@ TEST_F(TestTypeSystemClang, TestFunctionTemplateConstruction) {
869869
CompilerType clang_type = m_ast->CreateFunctionType(int_type, {}, false, 0U);
870870
FunctionDecl *func = m_ast->CreateFunctionDeclaration(
871871
TU, OptionalClangModuleID(), "foo", clang_type, StorageClass::SC_None,
872-
<<<<<<< HEAD
873872
false, /*asm_label=*/{});
874-
=======
875-
false, std::nullopt);
876-
>>>>>>> 382395408c4b ([lldb][Expression] Encode Module and DIE UIDs into function AsmLabels)
877873
TypeSystemClang::TemplateParameterInfos empty_params;
878874

879875
// Create the actual function template.
@@ -904,11 +900,7 @@ TEST_F(TestTypeSystemClang, TestFunctionTemplateInRecordConstruction) {
904900
// 2. It is mirroring the behavior of DWARFASTParserClang::ParseSubroutine.
905901
FunctionDecl *func = m_ast->CreateFunctionDeclaration(
906902
TU, OptionalClangModuleID(), "foo", clang_type, StorageClass::SC_None,
907-
<<<<<<< HEAD
908903
false, /*asm_label=*/{});
909-
=======
910-
false, std::nullopt);
911-
>>>>>>> 382395408c4b ([lldb][Expression] Encode Module and DIE UIDs into function AsmLabels)
912904
TypeSystemClang::TemplateParameterInfos empty_params;
913905

914906
// Create the actual function template.
@@ -946,11 +938,7 @@ TEST_F(TestTypeSystemClang, TestDeletingImplicitCopyCstrDueToMoveCStr) {
946938
bool is_attr_used = false;
947939
bool is_artificial = false;
948940
m_ast->AddMethodToCXXRecordType(
949-
<<<<<<< HEAD
950941
t.GetOpaqueQualType(), class_name, /*asm_label=*/{}, function_type,
951-
=======
952-
t.GetOpaqueQualType(), class_name, std::nullopt, function_type,
953-
>>>>>>> 382395408c4b ([lldb][Expression] Encode Module and DIE UIDs into function AsmLabels)
954942
lldb::AccessType::eAccessPublic, is_virtual, is_static, is_inline,
955943
is_explicit, is_attr_used, is_artificial);
956944

@@ -987,11 +975,7 @@ TEST_F(TestTypeSystemClang, TestNotDeletingUserCopyCstrDueToMoveCStr) {
987975
CompilerType function_type = m_ast->CreateFunctionType(
988976
return_type, args, /*variadic=*/false, /*quals*/ 0U);
989977
m_ast->AddMethodToCXXRecordType(
990-
<<<<<<< HEAD
991978
t.GetOpaqueQualType(), class_name, /*asm_label=*/{}, function_type,
992-
=======
993-
t.GetOpaqueQualType(), class_name, std::nullopt, function_type,
994-
>>>>>>> 382395408c4b ([lldb][Expression] Encode Module and DIE UIDs into function AsmLabels)
995979
lldb::AccessType::eAccessPublic, is_virtual, is_static, is_inline,
996980
is_explicit, is_attr_used, is_artificial);
997981
}
@@ -1003,11 +987,7 @@ TEST_F(TestTypeSystemClang, TestNotDeletingUserCopyCstrDueToMoveCStr) {
1003987
m_ast->CreateFunctionType(return_type, args,
1004988
/*variadic=*/false, /*quals*/ 0U);
1005989
m_ast->AddMethodToCXXRecordType(
1006-
<<<<<<< HEAD
1007990
t.GetOpaqueQualType(), class_name, /*asm_label=*/{}, function_type,
1008-
=======
1009-
t.GetOpaqueQualType(), class_name, std::nullopt, function_type,
1010-
>>>>>>> 382395408c4b ([lldb][Expression] Encode Module and DIE UIDs into function AsmLabels)
1011991
lldb::AccessType::eAccessPublic, is_virtual, is_static, is_inline,
1012992
is_explicit, is_attr_used, is_artificial);
1013993
}
@@ -1118,11 +1098,7 @@ TEST_F(TestTypeSystemClang, AddMethodToCXXRecordType_ParmVarDecls) {
11181098
m_ast->CreateFunctionType(return_type, param_types,
11191099
/*variadic=*/false, /*quals*/ 0U);
11201100
m_ast->AddMethodToCXXRecordType(
1121-
<<<<<<< HEAD
11221101
t.GetOpaqueQualType(), "myFunc", /*asm_label=*/{}, function_type,
1123-
=======
1124-
t.GetOpaqueQualType(), "myFunc", std::nullopt, function_type,
1125-
>>>>>>> 382395408c4b ([lldb][Expression] Encode Module and DIE UIDs into function AsmLabels)
11261102
lldb::AccessType::eAccessPublic, is_virtual, is_static, is_inline,
11271103
is_explicit, is_attr_used, is_artificial);
11281104

0 commit comments

Comments
 (0)