[Lldb-commits] [lldb] r374341 - Fix some dangling else warnings
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 10 06:23:02 PDT 2019
Author: labath
Date: Thu Oct 10 06:23:02 2019
New Revision: 374341
URL: http://llvm.org/viewvc/llvm-project?rev=374341&view=rev
Log:
Fix some dangling else warnings
EXPECT_EQ contains an if-else statement. It also contains some magic to
suppress the dangling else warnings, but it seems that some new
compilers can see through that...
Modified:
lldb/trunk/unittests/Process/minidump/RegisterContextMinidumpTest.cpp
Modified: lldb/trunk/unittests/Process/minidump/RegisterContextMinidumpTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/RegisterContextMinidumpTest.cpp?rev=374341&r1=374340&r2=374341&view=diff
==============================================================================
--- lldb/trunk/unittests/Process/minidump/RegisterContextMinidumpTest.cpp (original)
+++ lldb/trunk/unittests/Process/minidump/RegisterContextMinidumpTest.cpp Thu Oct 10 06:23:02 2019
@@ -157,33 +157,34 @@ static void TestARMRegInfo(const lldb_pr
EXPECT_NE(info->kinds[lldb::eRegisterKindDWARF], LLDB_INVALID_REGNUM);
}
// Verify generic register are set correctly
- if (name == "r0")
+ if (name == "r0") {
EXPECT_EQ(info->kinds[lldb::eRegisterKindGeneric],
(uint32_t)LLDB_REGNUM_GENERIC_ARG1);
- else if (name == "r1")
+ } else if (name == "r1") {
EXPECT_EQ(info->kinds[lldb::eRegisterKindGeneric],
(uint32_t)LLDB_REGNUM_GENERIC_ARG2);
- else if (name == "r2")
+ } else if (name == "r2") {
EXPECT_EQ(info->kinds[lldb::eRegisterKindGeneric],
(uint32_t)LLDB_REGNUM_GENERIC_ARG3);
- else if (name == "r3")
+ } else if (name == "r3") {
EXPECT_EQ(info->kinds[lldb::eRegisterKindGeneric],
(uint32_t)LLDB_REGNUM_GENERIC_ARG4);
- else if (name == "sp")
+ } else if (name == "sp") {
EXPECT_EQ(info->kinds[lldb::eRegisterKindGeneric],
(uint32_t)LLDB_REGNUM_GENERIC_SP);
- else if (name == "fp")
+ } else if (name == "fp") {
EXPECT_EQ(info->kinds[lldb::eRegisterKindGeneric],
(uint32_t)LLDB_REGNUM_GENERIC_FP);
- else if (name == "lr")
+ } else if (name == "lr") {
EXPECT_EQ(info->kinds[lldb::eRegisterKindGeneric],
(uint32_t)LLDB_REGNUM_GENERIC_RA);
- else if (name == "pc")
+ } else if (name == "pc") {
EXPECT_EQ(info->kinds[lldb::eRegisterKindGeneric],
(uint32_t)LLDB_REGNUM_GENERIC_PC);
- else if (name == "cpsr")
+ } else if (name == "cpsr") {
EXPECT_EQ(info->kinds[lldb::eRegisterKindGeneric],
(uint32_t)LLDB_REGNUM_GENERIC_FLAGS);
+ }
}
TEST(RegisterContextMinidump, CheckRegisterContextMinidump_ARM) {
More information about the lldb-commits
mailing list