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<TranslationUnitDecl>(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<TranslationUnitDecl>(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

Reply via email to