"vscode:/vscode.git/clone" did not exist on "808b06557078626556ac855e196cbd788a9a9857"
Commit daa86f8c authored by Paul's avatar Paul
Browse files

Improve static analysis

parent 3e0496fb
...@@ -46,6 +46,12 @@ add_compile_options(-std=c++14) ...@@ -46,6 +46,12 @@ add_compile_options(-std=c++14)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(EnableCompilerWarnings) include(EnableCompilerWarnings)
include(ROCMClangTidy) include(ROCMClangTidy)
if(CMAKE_CXX_COMPILER MATCHES ".*hcc")
set(MIGRAPHX_TIDY_ERRORS ERRORS * -readability-inconsistent-declaration-parameter-name)
# Enable tidy on hip
elseif(MIGRAPHX_ENABLE_GPU)
set(MIGRAPHX_TIDY_ERRORS ALL)
endif()
rocm_enable_clang_tidy( rocm_enable_clang_tidy(
CHECKS CHECKS
* *
...@@ -100,15 +106,18 @@ rocm_enable_clang_tidy( ...@@ -100,15 +106,18 @@ rocm_enable_clang_tidy(
-*-use-auto -*-use-auto
-*-use-emplace -*-use-emplace
-*-use-equals-default -*-use-equals-default
ERRORS ${MIGRAPHX_TIDY_ERRORS}
*
-readability-inconsistent-declaration-parameter-name
HEADER_FILTER HEADER_FILTER
".*hpp" ".*hpp"
EXTRA_ARGS EXTRA_ARGS
-DMIGRAPHX_USE_CLANG_TIDY -DMIGRAPHX_USE_CLANG_TIDY
"-Dmain\\\\(...\\\\)=main\\\\(__VA_ARGS__\\\\) // NOLINT" "-Dmain\\\\(...\\\\)=main\\\\(__VA_ARGS__\\\\) // NOLINT"
CLANG_ARGS
-analyzer-config optin.cplusplus.UninitializedObject:Pedantic=true
-analyzer-config widen-loops=true
-analyzer-config unroll-loops=true
-analyzer-config cfg-lifetime=true
-analyzer-config cfg-scopes=true
) )
include(ROCMCppCheck) include(ROCMCppCheck)
rocm_enable_cppcheck( rocm_enable_cppcheck(
...@@ -145,6 +154,8 @@ rocm_enable_cppcheck( ...@@ -145,6 +154,8 @@ rocm_enable_cppcheck(
${CMAKE_CURRENT_SOURCE_DIR}/test/include ${CMAKE_CURRENT_SOURCE_DIR}/test/include
DEFINE DEFINE
CPPCHECK=1 CPPCHECK=1
__device__=
__host__=
) )
enable_testing() enable_testing()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment