Skip to content

[NFC][LLVM] Fix a couple of build warnings #116490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2024
Merged

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Nov 16, 2024

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

@jurahul jurahul marked this pull request as ready for review November 16, 2024 17:16
@llvmbot llvmbot added the LTO Link time optimization (regular/full LTO or ThinLTO) label Nov 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 16, 2024

@llvm/pr-subscribers-lto

Author: Rahul Joshi (jurahul)

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

Full diff: https://github.com/llvm/llvm-project/pull/116490.diff

2 Files Affected:

  • (modified) llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp (+2-2)
  • (modified) llvm/lib/LTO/LTOBackend.cpp (+2)
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) {

Copy link
Contributor

@teresajohnson teresajohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jurahul jurahul merged commit 5c8c90d into llvm:main Nov 17, 2024
12 checks passed
@jurahul jurahul deleted the fix_warnings branch November 17, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTO Link time optimization (regular/full LTO or ThinLTO)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants