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)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(EnableCompilerWarnings)
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(
CHECKS
*
......@@ -100,15 +106,18 @@ rocm_enable_clang_tidy(
-*-use-auto
-*-use-emplace
-*-use-equals-default
ERRORS
*
-readability-inconsistent-declaration-parameter-name
${MIGRAPHX_TIDY_ERRORS}
HEADER_FILTER
".*hpp"
EXTRA_ARGS
-DMIGRAPHX_USE_CLANG_TIDY
"-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)
rocm_enable_cppcheck(
......@@ -145,6 +154,8 @@ rocm_enable_cppcheck(
${CMAKE_CURRENT_SOURCE_DIR}/test/include
DEFINE
CPPCHECK=1
__device__=
__host__=
)
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