Skip to content

[lldb] Narrow scope of -Wno-deprecated-declarations (NFC) #112276

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
Oct 17, 2024

Conversation

JDevlieghere
Copy link
Member

Currently all of LLDB is being compiled with -Wno-deprecated-declarations. That's not desirable, especially as part of the LLVM monorepo, as we miss deprecation warnings from LLVM and clang.

According to the git history, this was first introduced to suppress warnings related to auto_ptr. Since then, other things have been deprecated and gone unnoticed. This patch limits the flag to Host.mm which uses a handful of LSApplication headers that have no replacement.

rdar://112040718

Currently all of LLDB is being compiled with -Wno-deprecated-declarations.
That's not desirable, especially as part of the LLVM monorepo, as we
miss deprecation warnings from LLVM and clang.

According to the git history, this was first introduced to suppress
warnings related to auto_ptr. Since then, other things have been
deprecated and gone unnoticed. This patch limits the flag to Host.mm
which uses a handful of LSApplication headers that have no replacement.

rdar://112040718
JDevlieghere added a commit to JDevlieghere/llvm-project that referenced this pull request Oct 15, 2024
Disable -Wdeprecated-declarations for codecvt_utf8 in Editline. This is
in preparation for llvm#112276 which narrows the scope of
-Wno-deprecated-declarations for building LLDB.
@JDevlieghere JDevlieghere marked this pull request as ready for review October 15, 2024 22:23
@llvmbot llvmbot added the lldb label Oct 15, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2024

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

Currently all of LLDB is being compiled with -Wno-deprecated-declarations. That's not desirable, especially as part of the LLVM monorepo, as we miss deprecation warnings from LLVM and clang.

According to the git history, this was first introduced to suppress warnings related to auto_ptr. Since then, other things have been deprecated and gone unnoticed. This patch limits the flag to Host.mm which uses a handful of LSApplication headers that have no replacement.

rdar://112040718


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

2 Files Affected:

  • (modified) lldb/cmake/modules/LLDBConfig.cmake (-2)
  • (modified) lldb/source/Host/macosx/objcxx/CMakeLists.txt (+3-1)
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index a60921990cf775..93ccd9c479c2b8 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -188,7 +188,6 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include")
 
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
   # Disable GCC warnings
-  append("-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)
   append("-Wno-unknown-pragmas" CMAKE_CXX_FLAGS)
   append("-Wno-strict-aliasing" CMAKE_CXX_FLAGS)
 
@@ -198,7 +197,6 @@ endif()
 
 # Disable Clang warnings
 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  append("-Wno-deprecated-register" CMAKE_CXX_FLAGS)
   append("-Wno-vla-extension" CMAKE_CXX_FLAGS)
 endif()
 
diff --git a/lldb/source/Host/macosx/objcxx/CMakeLists.txt b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
index 273999f24380e5..1e693bed12ce15 100644
--- a/lldb/source/Host/macosx/objcxx/CMakeLists.txt
+++ b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
@@ -16,4 +16,6 @@ add_lldb_library(lldbHostMacOSXObjCXX NO_PLUGIN_DEPENDENCIES
     TargetParser
   )
 
-target_compile_options(lldbHostMacOSXObjCXX PRIVATE -fno-objc-exceptions)
+target_compile_options(lldbHostMacOSXObjCXX PRIVATE
+  -fno-objc-exceptions
+  -Wno-deprecated-declarations)

Copy link
Collaborator

@labath labath left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning this up.

Copy link
Member

@bulbazord bulbazord left a comment

Choose a reason for hiding this comment

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

🥳

JDevlieghere added a commit that referenced this pull request Oct 17, 2024
Disable -Wdeprecated-declarations for codecvt_utf8 in Editline. This is
in preparation for #112276 which narrows the scope of
-Wno-deprecated-declarations for building LLDB.
@JDevlieghere JDevlieghere merged commit 4897fc4 into llvm:main Oct 17, 2024
11 checks passed
@JDevlieghere JDevlieghere deleted the rdar112040718 branch October 17, 2024 15:23
JDevlieghere added a commit to swiftlang/llvm-project that referenced this pull request Oct 22, 2024
)

Disable -Wdeprecated-declarations for codecvt_utf8 in Editline. This is
in preparation for llvm#112276 which narrows the scope of
-Wno-deprecated-declarations for building LLDB.

(cherry picked from commit 8c7f80f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants