Skip to content
Snippets Groups Projects
Commit 3de2b346 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

ENH: Explicitly recognize virtual functions

    clang-tidy tool can insert missing override keyword as a macro so that missing [optional] virtual identifiers can be easily added.

    build otb with clang 3.8 and use cmake option CMAKE_EXPORT_COMPILE_COMMANDS=ON. Most modules and third parties have been activated.

    #Save override occurences in otb code
    cd src/Modules ; grep -nR "override" * > ~/temporary/override_otb.txt

    #Run clang modernize check using utility script which allow to process the code in parallel
    python run-clang-tidy.py -clang-tidy-binary ~/software/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang-tidy -checks=-*,modernize-use-override -header-filter=/home/grizonnetm/projets/otb/src/OTB/Modules/.*/.*/include/.* -j8 -fix -p ~/projets/otb/bin/release/OTB-clang3.8/ ~/projets/otb/src/OTB/Modules/*/*/src/*.cxx ~/projets/otb/src/OTB/Examples/*/*.cxx ~/projets/otb/src/OTB/Modules/*/*/test/*.cxx > ~/temporary/run-clang-tidy-log.txt

    #Replace override by ITK macro (to maintain compat with c++98)
    find . -type f -print -name "*.h" -o -name "*.txx" |xargs perl -pi -e 's/\ override/\ ITK_OVERRIDE/g'
parent a0f2bdc1
No related branches found
No related tags found
Loading
Showing
with 53 additions and 53 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment