[lld] c282708 - Fix [-Werror,-Wsign-compare] warnings arising from subsection symbols patch.
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 9 13:36:42 PDT 2020
This seems to have broken http://45.33.8.238/win/19452/step_4.txt
On Thu, Jul 9, 2020 at 9:18 PM Eric Christopher via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Eric Christopher
> Date: 2020-07-09T11:14:00-07:00
> New Revision: c2827083166cd5150232d8fd3ada3cf8fa8c9ac3
>
> URL: https://github.com/llvm/llvm-project/commit/c2827083166cd5150232d8fd3ada3cf8fa8c9ac3
> DIFF: https://github.com/llvm/llvm-project/commit/c2827083166cd5150232d8fd3ada3cf8fa8c9ac3.diff
>
> LOG: Fix [-Werror,-Wsign-compare] warnings arising from subsection symbols patch.
>
> Added:
>
>
> Modified:
> lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
> lld/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp
>
> Removed:
>
>
>
> ################################################################################
> diff --git a/lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp b/lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
> index aad5f8afcfdc..07c1d4242e03 100644
> --- a/lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
> +++ b/lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
> @@ -75,7 +75,7 @@ TEST(BinaryReaderTest, empty_obj_x86_64) {
> fromBinary(fileBytes, sizeof(fileBytes), "x86_64");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
> EXPECT_EQ((int)(f->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> EXPECT_TRUE(f->undefinedSymbols.empty());
> @@ -106,7 +106,7 @@ TEST(BinaryReaderTest, empty_obj_x86) {
> fromBinary(fileBytes, sizeof(fileBytes), "i386");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86);
> EXPECT_EQ((int)(f->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> EXPECT_TRUE(f->undefinedSymbols.empty());
> @@ -137,7 +137,7 @@ TEST(BinaryReaderTest, empty_obj_ppc) {
> fromBinary(fileBytes, sizeof(fileBytes), "ppc");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_ppc);
> EXPECT_EQ((int)(f->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> EXPECT_TRUE(f->undefinedSymbols.empty());
> @@ -168,7 +168,7 @@ TEST(BinaryReaderTest, empty_obj_armv7) {
> fromBinary(fileBytes, sizeof(fileBytes), "armv7");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7);
> EXPECT_EQ((int)(f->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> EXPECT_TRUE(f->undefinedSymbols.empty());
> @@ -182,7 +182,7 @@ TEST(BinaryReaderTest, empty_obj_x86_64_arm7) {
> fromBinary(fileBytes, sizeof(fileBytes), "x86_64");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
> EXPECT_EQ((int)(f->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> EXPECT_TRUE(f->undefinedSymbols.empty());
> @@ -191,7 +191,7 @@ TEST(BinaryReaderTest, empty_obj_x86_64_arm7) {
> fromBinary(fileBytes, sizeof(fileBytes), "armv7");
> EXPECT_EQ(f2->arch, lld::MachOLinkingContext::arch_armv7);
> EXPECT_EQ((int)(f2->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f2->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f2->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f2->localSymbols.empty());
> EXPECT_TRUE(f2->globalSymbols.empty());
> EXPECT_TRUE(f2->undefinedSymbols.empty());
> @@ -268,7 +268,7 @@ TEST(BinaryReaderTest, hello_obj_x86_64) {
>
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
> EXPECT_EQ((int)(f->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_EQ(f->sections.size(), 2UL);
> const Section& text = f->sections[0];
> EXPECT_TRUE(text.segmentName.equals("__TEXT"));
> @@ -393,7 +393,7 @@ TEST(BinaryReaderTest, hello_obj_x86) {
>
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86);
> EXPECT_EQ((int)(f->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_EQ(f->sections.size(), 2UL);
> const Section& text = f->sections[0];
> EXPECT_TRUE(text.segmentName.equals("__TEXT"));
> @@ -525,7 +525,7 @@ TEST(BinaryReaderTest, hello_obj_armv7) {
>
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7);
> EXPECT_EQ((int)(f->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_EQ(f->sections.size(), 2UL);
> const Section& text = f->sections[0];
> EXPECT_TRUE(text.segmentName.equals("__TEXT"));
> @@ -669,7 +669,7 @@ TEST(BinaryReaderTest, hello_obj_ppc) {
>
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_ppc);
> EXPECT_EQ((int)(f->fileType), MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_EQ(f->sections.size(), 2UL);
> const Section& text = f->sections[0];
> EXPECT_TRUE(text.segmentName.equals("__TEXT"));
>
> diff --git a/lld/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp b/lld/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp
> index 6ceb197b4b84..c1445ea7eacd 100644
> --- a/lld/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp
> +++ b/lld/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp
> @@ -50,7 +50,7 @@ TEST(ObjectFileYAML, empty_ppc) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_ppc);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->sections.empty());
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> @@ -66,7 +66,7 @@ TEST(ObjectFileYAML, empty_x86_64) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->sections.empty());
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> @@ -82,7 +82,7 @@ TEST(ObjectFileYAML, empty_x86) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->sections.empty());
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> @@ -98,7 +98,7 @@ TEST(ObjectFileYAML, empty_armv6) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv6);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->sections.empty());
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> @@ -114,7 +114,7 @@ TEST(ObjectFileYAML, empty_armv7) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->sections.empty());
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> @@ -130,7 +130,7 @@ TEST(ObjectFileYAML, empty_armv7s) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7s);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f->sections.empty());
> EXPECT_TRUE(f->localSymbols.empty());
> EXPECT_TRUE(f->globalSymbols.empty());
> @@ -151,7 +151,7 @@ TEST(ObjectFileYAML, roundTrip) {
> std::unique_ptr<NormalizedFile> f2 = fromYAML(intermediate);
> EXPECT_EQ(f2->arch, lld::MachOLinkingContext::arch_x86_64);
> EXPECT_EQ((int)(f2->fileType), llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f2->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f2->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_TRUE(f2->sections.empty());
> EXPECT_TRUE(f2->localSymbols.empty());
> EXPECT_TRUE(f2->globalSymbols.empty());
> @@ -275,7 +275,7 @@ TEST(ObjectFileYAML, hello_x86_64) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_EQ(f->sections.size(), 2UL);
>
> const Section& sect1 = f->sections[0];
> @@ -405,7 +405,7 @@ TEST(ObjectFileYAML, hello_x86) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_EQ(f->sections.size(), 2UL);
>
> const Section& sect1 = f->sections[0];
> @@ -533,7 +533,7 @@ TEST(ObjectFileYAML, hello_armv6) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv6);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_EQ(f->sections.size(), 2UL);
>
> const Section& sect1 = f->sections[0];
> @@ -673,7 +673,7 @@ TEST(ObjectFileYAML, hello_armv7) {
> "...\n");
> EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7);
> EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
> - EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> + EXPECT_EQ(f->flags, llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
> EXPECT_EQ(f->sections.size(), 2UL);
>
> const Section& sect1 = f->sections[0];
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list