[llvm] 5c8c90d - [NFC][LLVM] Fix a couple of build warnings (#116490)

via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 17 07:54:44 PST 2024


Author: Rahul Joshi
Date: 2024-11-17T07:54:41-08:00
New Revision: 5c8c90d8212d8720fd8630aecc634bdff6261ad6

URL: https://github.com/llvm/llvm-project/commit/5c8c90d8212d8720fd8630aecc634bdff6261ad6
DIFF: https://github.com/llvm/llvm-project/commit/5c8c90d8212d8720fd8630aecc634bdff6261ad6.diff

LOG: [NFC][LLVM] Fix a couple of build warnings (#116490)

- Fix `HANDLE_EXTENSION` macro redefinition warning in LTOBackend.cpp
- Fix "unnecessary brackets" around rf/df variable definitions warning.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
    llvm/lib/LTO/LTOBackend.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
index fd11450b635b48..71036f33cf9291 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
@@ -42,7 +42,7 @@ extern "C" void __deregister_frame(void *);
 // but using the MingW runtime.
 static void __register_frame(void *p) {
   static bool Searched = false;
-  static void((*rf)(void *)) = 0;
+  static void (*rf)(void *) = 0;
 
   if (!Searched) {
     Searched = true;
@@ -55,7 +55,7 @@ static void __register_frame(void *p) {
 
 static void __deregister_frame(void *p) {
   static bool Searched = false;
-  static void((*df)(void *)) = 0;
+  static void (*df)(void *) = 0;
 
   if (!Searched) {
     Searched = true;

diff  --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index ad332d25d9c082..bdf4ff8960bc82 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -182,12 +182,14 @@ Error Config::addSaveTemps(std::string OutputFileName, bool UseInputModulePath,
 #define HANDLE_EXTENSION(Ext)                                                  \
   llvm::PassPluginLibraryInfo get##Ext##PluginInfo();
 #include "llvm/Support/Extension.def"
+#undef HANDLE_EXTENSION
 
 static void RegisterPassPlugins(ArrayRef<std::string> PassPlugins,
                                 PassBuilder &PB) {
 #define HANDLE_EXTENSION(Ext)                                                  \
   get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB);
 #include "llvm/Support/Extension.def"
+#undef HANDLE_EXTENSION
 
   // Load requested pass plugins and let them register pass builder callbacks
   for (auto &PluginFN : PassPlugins) {


        


More information about the llvm-commits mailing list