[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7dd42ecfa2a2: clang: Exclude efi_main from -Wmissing-prototypes (authored by DaanDeMeyer). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 Files: clang/lib/Sema/SemaDecl.cpp clang/test/Sema/no-warn-missing-prototype.c Index: clang/test/Sema/no-warn-missing-prototype.c === --- clang/test/Sema/no-warn-missing-prototype.c +++ clang/test/Sema/no-warn-missing-prototype.c @@ -4,3 +4,7 @@ int main() { return 0; } + +int efi_main() { + return 0; +} Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13873,7 +13873,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. Index: clang/test/Sema/no-warn-missing-prototype.c === --- clang/test/Sema/no-warn-missing-prototype.c +++ clang/test/Sema/no-warn-missing-prototype.c @@ -4,3 +4,7 @@ int main() { return 0; } + +int efi_main() { + return 0; +} Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13873,7 +13873,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
dblaikie accepted this revision. dblaikie added a comment. Reaffirming approval with the test change - looks great! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
DaanDeMeyer added a comment. I should be able to commit it myself. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
DaanDeMeyer updated this revision to Diff 325224. DaanDeMeyer added a comment. Moved the test into the no-warn-missing-prototype test as requested. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 Files: clang/lib/Sema/SemaDecl.cpp clang/test/Sema/no-warn-missing-prototype.c Index: clang/test/Sema/no-warn-missing-prototype.c === --- clang/test/Sema/no-warn-missing-prototype.c +++ clang/test/Sema/no-warn-missing-prototype.c @@ -4,3 +4,7 @@ int main() { return 0; } + +int efi_main() { + return 0; +} Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13873,7 +13873,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. Index: clang/test/Sema/no-warn-missing-prototype.c === --- clang/test/Sema/no-warn-missing-prototype.c +++ clang/test/Sema/no-warn-missing-prototype.c @@ -4,3 +4,7 @@ int main() { return 0; } + +int efi_main() { + return 0; +} Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13873,7 +13873,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
dblaikie accepted this revision. dblaikie added a comment. This revision is now accepted and ready to land. Looks good to me - maybe the test could be rolled into whatever file is already testing -Wmissing-prototype and the existing special case for "main"? Do you need me to commit this, or can you commit it yourself? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
DaanDeMeyer added a comment. Added a test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
DaanDeMeyer updated this revision to Diff 325114. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 Files: clang/lib/Sema/SemaDecl.cpp clang/test/Sema/no-warn-missing-prototype-efi.c Index: clang/test/Sema/no-warn-missing-prototype-efi.c === --- /dev/null +++ clang/test/Sema/no-warn-missing-prototype-efi.c @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -fsyntax-only -Wmissing-prototypes -x c -ffreestanding -verify %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-prototypes -x c++ -ffreestanding -verify %s +// expected-no-diagnostics +int efi_main() { + return 0; +} Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13873,7 +13873,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. Index: clang/test/Sema/no-warn-missing-prototype-efi.c === --- /dev/null +++ clang/test/Sema/no-warn-missing-prototype-efi.c @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -fsyntax-only -Wmissing-prototypes -x c -ffreestanding -verify %s +// RUN: %clang_cc1 -fsyntax-only -Wmissing-prototypes -x c++ -ffreestanding -verify %s +// expected-no-diagnostics +int efi_main() { + return 0; +} Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13873,7 +13873,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
dblaikie added a comment. Please include test coverage Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
DaanDeMeyer updated this revision to Diff 320899. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 Files: clang/lib/Sema/SemaDecl.cpp Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13867,7 +13867,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13867,7 +13867,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
DaanDeMeyer added a comment. CI failures seem unrelated? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95746/new/ https://reviews.llvm.org/D95746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95746: clang: Exclude efi_main from -Wmissing-prototypes
DaanDeMeyer created this revision. DaanDeMeyer added a reviewer: clang. DaanDeMeyer added a project: clang. DaanDeMeyer requested review of this revision. Herald added a subscriber: cfe-commits. When compiling UEFI applications, the main function is named efi_main() instead of main(). Let's exclude efi_main() from -Wmissing-prototypes as well to avoid warnings when working on UEFI applications. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D95746 Files: clang/lib/Sema/SemaDecl.cpp Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13867,7 +13867,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. Index: clang/lib/Sema/SemaDecl.cpp === --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -13867,7 +13867,7 @@ // Don't warn about 'main'. if (isa(FD->getDeclContext()->getRedeclContext())) if (IdentifierInfo *II = FD->getIdentifier()) - if (II->isStr("main")) + if (II->isStr("main") || II->isStr("efi_main")) return false; // Don't warn about inline functions. ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits