kastiglione created this revision.
kastiglione added reviewers: JDevlieghere, aprantl, jasonmolenda.
Herald added a subscriber: mgorny.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Enable `-Wmisleading-indentation` to balance with the LLVM style of optional 
parentheses.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102092

Files:
  lldb/cmake/modules/LLDBConfig.cmake


Index: lldb/cmake/modules/LLDBConfig.cmake
===================================================================
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -158,6 +158,12 @@
 endif ()
 include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include")
 
+# Prevent bugs via useful warnings.
+if (LLVM_ENABLE_WARNINGS)
+  check_cxx_compiler_flag("-Wmisleading-indentation" 
CXX_SUPPORTS_MISLEADING_INDENTATION)
+  append_if(CXX_SUPPORTS_MISLEADING_INDENTATION "-Wmisleading-indentation" 
CMAKE_CXX_FLAGS)
+endif()
+
 # Disable GCC warnings
 check_cxx_compiler_flag("-Wno-deprecated-declarations" 
CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS)
 append_if(CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS 
"-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)


Index: lldb/cmake/modules/LLDBConfig.cmake
===================================================================
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -158,6 +158,12 @@
 endif ()
 include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include")
 
+# Prevent bugs via useful warnings.
+if (LLVM_ENABLE_WARNINGS)
+  check_cxx_compiler_flag("-Wmisleading-indentation" CXX_SUPPORTS_MISLEADING_INDENTATION)
+  append_if(CXX_SUPPORTS_MISLEADING_INDENTATION "-Wmisleading-indentation" CMAKE_CXX_FLAGS)
+endif()
+
 # Disable GCC warnings
 check_cxx_compiler_flag("-Wno-deprecated-declarations" CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS)
 append_if(CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS "-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to