[Lldb-commits] [PATCH] D40757: Disable warnings related to anonymous types in the ObjC plugin
This revision was automatically updated to reflect the committed changes. Closed by commit rL320071: Disable warnings related to anonymous types in the ObjC plugin (authored by vedantk). Changed prior to commit: https://reviews.llvm.org/D40757?vs=125816=125999#toc Repository: rL LLVM https://reviews.llvm.org/D40757 Files: lldb/trunk/cmake/modules/AddLLDB.cmake lldb/trunk/cmake/modules/LLDBConfig.cmake lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt Index: lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt === --- lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt +++ lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt @@ -1,3 +1,13 @@ +set(EXTRA_CXXFLAGS "") + +if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT) + set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-gnu-anonymous-struct) +endif () + +if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES) + set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-nested-anon-types) +endif () + add_lldb_library(lldbPluginObjCLanguage PLUGIN ObjCLanguage.cpp CF.cpp @@ -21,4 +31,6 @@ lldbTarget lldbUtility lldbPluginAppleObjCRuntime + + EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} ) Index: lldb/trunk/cmake/modules/AddLLDB.cmake === --- lldb/trunk/cmake/modules/AddLLDB.cmake +++ lldb/trunk/cmake/modules/AddLLDB.cmake @@ -4,7 +4,7 @@ cmake_parse_arguments(PARAM "MODULE;SHARED;STATIC;OBJECT;PLUGIN" "" -"DEPENDS;LINK_LIBS;LINK_COMPONENTS" +"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS" ${ARGN}) llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS}) list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS}) @@ -35,6 +35,8 @@ endif() #PIC not needed on Win + # FIXME: Setting CMAKE_CXX_FLAGS here is a no-op, use target_compile_options + # or omit this logic instead. if (NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() @@ -78,6 +80,9 @@ # headers without negatively impacting much of anything. add_dependencies(${name} clang-tablegen-targets) + # Add in any extra C++ compilation flags for this library. + target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS}) + set_target_properties(${name} PROPERTIES FOLDER "lldb libraries") endfunction(add_lldb_library) Index: lldb/trunk/cmake/modules/LLDBConfig.cmake === --- lldb/trunk/cmake/modules/LLDBConfig.cmake +++ lldb/trunk/cmake/modules/LLDBConfig.cmake @@ -231,6 +231,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension") endif () +check_cxx_compiler_flag("-Wno-gnu-anonymous-struct" +CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT) + +check_cxx_compiler_flag("-Wno-nested-anon-types" +CXX_SUPPORTS_NO_NESTED_ANON_TYPES) + # Disable MSVC warnings if( MSVC ) add_definitions( Index: lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt === --- lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt +++ lldb/trunk/source/Plugins/Language/ObjC/CMakeLists.txt @@ -1,3 +1,13 @@ +set(EXTRA_CXXFLAGS "") + +if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT) + set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-gnu-anonymous-struct) +endif () + +if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES) + set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-nested-anon-types) +endif () + add_lldb_library(lldbPluginObjCLanguage PLUGIN ObjCLanguage.cpp CF.cpp @@ -21,4 +31,6 @@ lldbTarget lldbUtility lldbPluginAppleObjCRuntime + + EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} ) Index: lldb/trunk/cmake/modules/AddLLDB.cmake === --- lldb/trunk/cmake/modules/AddLLDB.cmake +++ lldb/trunk/cmake/modules/AddLLDB.cmake @@ -4,7 +4,7 @@ cmake_parse_arguments(PARAM "MODULE;SHARED;STATIC;OBJECT;PLUGIN" "" -"DEPENDS;LINK_LIBS;LINK_COMPONENTS" +"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS" ${ARGN}) llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS}) list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS}) @@ -35,6 +35,8 @@ endif() #PIC not needed on Win + # FIXME: Setting CMAKE_CXX_FLAGS here is a no-op, use target_compile_options + # or omit this logic instead. if (NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() @@ -78,6 +80,9 @@ # headers without negatively impacting much of anything. add_dependencies(${name} clang-tablegen-targets) + # Add in any extra C++ compilation flags for this library. + target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS}) + set_target_properties(${name} PROPERTIES FOLDER "lldb libraries") endfunction(add_lldb_library) Index: lldb/trunk/cmake/modules/LLDBConfig.cmake === --- lldb/trunk/cmake/modules/LLDBConfig.cmake +++
[Lldb-commits] [PATCH] D40757: Disable warnings related to anonymous types in the ObjC plugin
davide added a comment. LGTM (again) https://reviews.llvm.org/D40757 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D40757: Disable warnings related to anonymous types in the ObjC plugin
labath accepted this revision. labath added a comment. Cool. Thanks. https://reviews.llvm.org/D40757 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D40757: Disable warnings related to anonymous types in the ObjC plugin
vsk updated this revision to Diff 125816. vsk retitled this revision from "Disable warnings related to anonymous types" to "Disable warnings related to anonymous types in the ObjC plugin". vsk edited the summary of this revision. vsk added a comment. - Thanks @labath! I've disabled the GNU warnings in a narrower way. PTAL. https://reviews.llvm.org/D40757 Files: cmake/modules/AddLLDB.cmake cmake/modules/LLDBConfig.cmake source/Plugins/Language/ObjC/CMakeLists.txt Index: source/Plugins/Language/ObjC/CMakeLists.txt === --- source/Plugins/Language/ObjC/CMakeLists.txt +++ source/Plugins/Language/ObjC/CMakeLists.txt @@ -1,3 +1,13 @@ +set(EXTRA_CXXFLAGS "") + +if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT) + set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-gnu-anonymous-struct) +endif () + +if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES) + set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-nested-anon-types) +endif () + add_lldb_library(lldbPluginObjCLanguage PLUGIN ObjCLanguage.cpp CF.cpp @@ -21,4 +31,6 @@ lldbTarget lldbUtility lldbPluginAppleObjCRuntime + + EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} ) Index: cmake/modules/LLDBConfig.cmake === --- cmake/modules/LLDBConfig.cmake +++ cmake/modules/LLDBConfig.cmake @@ -231,6 +231,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension") endif () +check_cxx_compiler_flag("-Wno-gnu-anonymous-struct" +CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT) + +check_cxx_compiler_flag("-Wno-nested-anon-types" +CXX_SUPPORTS_NO_NESTED_ANON_TYPES) + # Disable MSVC warnings if( MSVC ) add_definitions( Index: cmake/modules/AddLLDB.cmake === --- cmake/modules/AddLLDB.cmake +++ cmake/modules/AddLLDB.cmake @@ -4,7 +4,7 @@ cmake_parse_arguments(PARAM "MODULE;SHARED;STATIC;OBJECT;PLUGIN" "" -"DEPENDS;LINK_LIBS;LINK_COMPONENTS" +"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS" ${ARGN}) llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS}) list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS}) @@ -35,6 +35,8 @@ endif() #PIC not needed on Win + # FIXME: Setting CMAKE_CXX_FLAGS here is a no-op, use target_compile_options + # or omit this logic instead. if (NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() @@ -78,6 +80,9 @@ # headers without negatively impacting much of anything. add_dependencies(${name} clang-tablegen-targets) + # Add in any extra C++ compilation flags for this library. + target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS}) + set_target_properties(${name} PROPERTIES FOLDER "lldb libraries") endfunction(add_lldb_library) Index: source/Plugins/Language/ObjC/CMakeLists.txt === --- source/Plugins/Language/ObjC/CMakeLists.txt +++ source/Plugins/Language/ObjC/CMakeLists.txt @@ -1,3 +1,13 @@ +set(EXTRA_CXXFLAGS "") + +if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT) + set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-gnu-anonymous-struct) +endif () + +if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES) + set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-nested-anon-types) +endif () + add_lldb_library(lldbPluginObjCLanguage PLUGIN ObjCLanguage.cpp CF.cpp @@ -21,4 +31,6 @@ lldbTarget lldbUtility lldbPluginAppleObjCRuntime + + EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} ) Index: cmake/modules/LLDBConfig.cmake === --- cmake/modules/LLDBConfig.cmake +++ cmake/modules/LLDBConfig.cmake @@ -231,6 +231,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension") endif () +check_cxx_compiler_flag("-Wno-gnu-anonymous-struct" +CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT) + +check_cxx_compiler_flag("-Wno-nested-anon-types" +CXX_SUPPORTS_NO_NESTED_ANON_TYPES) + # Disable MSVC warnings if( MSVC ) add_definitions( Index: cmake/modules/AddLLDB.cmake === --- cmake/modules/AddLLDB.cmake +++ cmake/modules/AddLLDB.cmake @@ -4,7 +4,7 @@ cmake_parse_arguments(PARAM "MODULE;SHARED;STATIC;OBJECT;PLUGIN" "" -"DEPENDS;LINK_LIBS;LINK_COMPONENTS" +"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS" ${ARGN}) llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS}) list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS}) @@ -35,6 +35,8 @@ endif() #PIC not needed on Win + # FIXME: Setting CMAKE_CXX_FLAGS here is a no-op, use target_compile_options + # or omit this logic instead. if (NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() @@ -78,6 +80,9 @@ # headers without negatively impacting much of anything. add_dependencies(${name} clang-tablegen-targets) + # Add