[llvm] f44c6f2 - [cmake] Enable -Wmisleading-indentation
Dave Lee via llvm-commits
llvm-commits at lists.llvm.org
Mon May 10 09:56:12 PDT 2021
Author: Dave Lee
Date: 2021-05-10T09:56:04-07:00
New Revision: f44c6f20f5e9976357b4851c4432d96b4e4d3521
URL: https://github.com/llvm/llvm-project/commit/f44c6f20f5e9976357b4851c4432d96b4e4d3521
DIFF: https://github.com/llvm/llvm-project/commit/f44c6f20f5e9976357b4851c4432d96b4e4d3521.diff
LOG: [cmake] Enable -Wmisleading-indentation
Enable `-Wmisleading-indentation` to balance with the LLVM style of optional parentheses.
Differential Revision: https://reviews.llvm.org/D102092
Added:
Modified:
llvm/cmake/modules/HandleLLVMOptions.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 43cd88bc574d5..a64644a08e599 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -759,6 +759,9 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
# Enable -Wstring-conversion to catch misuse of string literals.
add_flag_if_supported("-Wstring-conversion" STRING_CONVERSION_FLAG)
+
+ # Prevent bugs that can happen with llvm's brace style.
+ add_flag_if_supported("-Wmisleading-indentation" MISLEADING_INDENTATION_FLAG)
endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)
More information about the llvm-commits
mailing list