adlint 3.2.0 → 3.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/AUTHORS +1 -2
- data/ChangeLog +196 -5236
- data/INSTALL +1 -1
- data/MANIFEST +4 -2
- data/NEWS +30 -13
- data/README +2 -2
- data/Rakefile +2 -2
- data/TODO +1 -1
- data/bin/adlint +2 -2
- data/bin/adlint_chk +2 -2
- data/bin/adlint_cma +2 -2
- data/bin/adlint_sma +2 -2
- data/bin/adlintize +2 -2
- data/etc/conf.d/fallback/cinit.erb +1 -1
- data/etc/conf.d/fallback/traits.erb +1 -1
- data/etc/conf.d/i686-cygwin/cinit-gcc_4.3.4.erb +1 -1
- data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +1 -1
- data/etc/conf.d/i686-devkit/cinit-gcc_4.5.2.erb +1 -1
- data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +1 -1
- data/etc/conf.d/i686-linux/cinit-gcc_4.5.1.erb +1 -1
- data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +1 -1
- data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +1 -1
- data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +1 -1
- data/etc/conf.d/noarch/GNUmakefile.erb +1 -1
- data/etc/conf.d/noarch/adlint_all_bat.erb +1 -1
- data/etc/conf.d/noarch/adlint_all_sh.erb +1 -1
- data/etc/conf.d/noarch/pinit.erb +1 -1
- data/etc/conf.d/x86_64-centos_6.4/cinit-gcc_4.4.7.erb +150 -0
- data/etc/conf.d/x86_64-centos_6.4/traits-gcc_4.4.7.erb +290 -0
- data/etc/conf.d/x86_64-ubuntu_12.04/cinit-gcc_4.6.3.erb +1 -1
- data/etc/conf.d/x86_64-ubuntu_12.04/traits-gcc_4.6.3.erb +1 -1
- data/etc/mesg.d/c_builtin/en_US/messages.yml +2 -2
- data/etc/mesg.d/c_builtin/ja_JP/messages.yml +3 -3
- data/etc/mesg.d/core/en_US/messages.yml +6 -2
- data/etc/mesg.d/core/ja_JP/messages.yml +6 -2
- data/features/code_check/E0008.feature +122 -0
- data/features/code_check/E0016.feature +49 -0
- data/features/code_check/E0018.feature +99 -0
- data/features/code_check/W0460.feature +8 -8
- data/lib/adlint.rb +2 -2
- data/lib/adlint/analyzer.rb +2 -2
- data/lib/adlint/annot.rb +2 -2
- data/lib/adlint/cc1.rb +2 -2
- data/lib/adlint/cc1/branch.rb +2 -2
- data/lib/adlint/cc1/builtin.rb +2 -2
- data/lib/adlint/cc1/const.rb +2 -2
- data/lib/adlint/cc1/conv.rb +2 -2
- data/lib/adlint/cc1/ctrlexpr.rb +2 -2
- data/lib/adlint/cc1/domain.rb +2 -2
- data/lib/adlint/cc1/enum.rb +2 -2
- data/lib/adlint/cc1/environ.rb +2 -2
- data/lib/adlint/cc1/expr.rb +110 -48
- data/lib/adlint/cc1/format.rb +2 -2
- data/lib/adlint/cc1/interp.rb +46 -12
- data/lib/adlint/cc1/lexer.rb +44 -11
- data/lib/adlint/cc1/mediator.rb +16 -2
- data/lib/adlint/cc1/object.rb +2 -2
- data/lib/adlint/cc1/operator.rb +2 -2
- data/lib/adlint/cc1/option.rb +3 -3
- data/lib/adlint/cc1/parser.rb +1011 -999
- data/lib/adlint/cc1/parser.y +20 -11
- data/lib/adlint/cc1/phase.rb +2 -2
- data/lib/adlint/cc1/resolver.rb +2 -2
- data/lib/adlint/cc1/scanner.rb +2 -2
- data/lib/adlint/cc1/scope.rb +2 -2
- data/lib/adlint/cc1/seqp.rb +2 -2
- data/lib/adlint/cc1/syntax.rb +42 -10
- data/lib/adlint/cc1/trace.rb +2 -2
- data/lib/adlint/cc1/type.rb +72 -2
- data/lib/adlint/cc1/util.rb +2 -2
- data/lib/adlint/cc1/value.rb +9 -3
- data/lib/adlint/code.rb +2 -2
- data/lib/adlint/cpp.rb +2 -2
- data/lib/adlint/cpp/asm.rb +2 -2
- data/lib/adlint/cpp/constexpr.rb +1 -1
- data/lib/adlint/cpp/constexpr.y +2 -2
- data/lib/adlint/cpp/eval.rb +2 -2
- data/lib/adlint/cpp/lexer.rb +13 -3
- data/lib/adlint/cpp/macro.rb +2 -2
- data/lib/adlint/cpp/phase.rb +2 -2
- data/lib/adlint/cpp/scanner.rb +2 -2
- data/lib/adlint/cpp/source.rb +2 -2
- data/lib/adlint/cpp/subst.rb +6 -2
- data/lib/adlint/cpp/syntax.rb +2 -2
- data/lib/adlint/cpp/util.rb +2 -2
- data/lib/adlint/driver.rb +2 -2
- data/lib/adlint/error.rb +2 -2
- data/lib/adlint/exam.rb +20 -8
- data/lib/adlint/exam/c_builtin.rb +4 -6
- data/lib/adlint/exam/c_builtin/cc1_check.rb +1380 -461
- data/lib/adlint/exam/c_builtin/cc1_code.rb +25 -25
- data/lib/adlint/exam/c_builtin/cc1_metric.rb +180 -209
- data/lib/adlint/exam/c_builtin/cpp_check.rb +211 -50
- data/lib/adlint/exam/c_builtin/cpp_code.rb +19 -19
- data/lib/adlint/exam/c_builtin/ld_check.rb +2 -2
- data/lib/adlint/exam/c_builtin/ld_metric.rb +2 -2
- data/lib/adlint/lang.rb +2 -2
- data/lib/adlint/ld.rb +2 -2
- data/lib/adlint/ld/object.rb +3 -3
- data/lib/adlint/ld/phase.rb +2 -2
- data/lib/adlint/ld/typedef.rb +2 -2
- data/lib/adlint/ld/util.rb +2 -2
- data/lib/adlint/lexer.rb +2 -2
- data/lib/adlint/location.rb +2 -2
- data/lib/adlint/memo.rb +2 -2
- data/lib/adlint/message.rb +2 -2
- data/lib/adlint/metric.rb +2 -2
- data/lib/adlint/monitor.rb +2 -2
- data/lib/adlint/phase.rb +2 -2
- data/lib/adlint/prelude.rb +2 -2
- data/lib/adlint/report.rb +4 -4
- data/lib/adlint/source.rb +2 -2
- data/lib/adlint/supp.rb +2 -2
- data/lib/adlint/symbol.rb +2 -2
- data/lib/adlint/token.rb +2 -2
- data/lib/adlint/traits.rb +2 -2
- data/lib/adlint/util.rb +2 -2
- data/lib/adlint/version.rb +6 -6
- data/share/HEADER +2 -2
- data/share/doc/developers_guide_ja.html +20 -9
- data/share/doc/developers_guide_ja.texi +18 -7
- data/share/doc/samples/GNUmakefile +1 -1
- data/share/doc/samples/adlint_traits.yml +1 -1
- data/share/doc/users_guide_en.html +6177 -6138
- data/share/doc/users_guide_en.texi +35 -5
- data/share/doc/users_guide_ja.html +6192 -6153
- data/share/doc/users_guide_ja.texi +35 -5
- data/share/sample/bison-2.5/adlint/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/adlint_traits.yml +1 -1
- data/share/sample/bison-2.5/adlint/lib/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_cinit.h +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_pinit.h +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +1 -1
- data/share/sample/bison-2.5/adlint/src/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_cinit.h +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_pinit.h +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +1 -1
- data/share/sample/ctags-5.8/adlint/GNUmakefile +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_cinit.h +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_pinit.h +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_traits.yml +1 -1
- data/share/sample/flex-2.5.35/adlint/GNUmakefile +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_cinit.h +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_pinit.h +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +1 -1
- data/share/sample/screen-4.0.3/adlint/GNUmakefile +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_cinit.h +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_pinit.h +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +1 -1
- data/share/sample/vim-7.3/adlint/vim/GNUmakefile +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_cinit.h +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_pinit.h +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +1 -1
- data/share/sample/vim-7.3/adlint/xxd/GNUmakefile +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_cinit.h +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_pinit.h +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +1 -1
- data/spec/adlint/cc1/ctrlexpr_spec.rb +3 -3
- data/spec/adlint/cc1/domain_spec.rb +2 -2
- data/spec/adlint/cc1/operator_spec.rb +2 -2
- data/spec/adlint/cc1/syntax_spec.rb +4 -4
- data/spec/adlint/cc1/type_spec.rb +2 -2
- data/spec/adlint/location_spec.rb +2 -2
- data/spec/conf.d/default_traits.yml +1 -1
- data/spec/conf.d/empty_cinit.h +1 -1
- data/spec/conf.d/empty_pinit.h +1 -1
- data/spec/spec_helper.rb +2 -2
- metadata +29 -28
- data/lib/adlint/exam/c_builtin/cc1_check_shima.rb +0 -963
- data/lib/adlint/exam/c_builtin/cpp_check_shima.rb +0 -204
@@ -1,7 +1,7 @@
|
|
1
1
|
# Code structure extractions (cc1-phase) of adlint-exam-c_builtin package.
|
2
2
|
#
|
3
3
|
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
4
|
-
# Copyright:: Copyright (C) 2010-
|
4
|
+
# Copyright:: Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
5
5
|
# License:: GPLv3+: GNU General Public License version 3 or later
|
6
6
|
#
|
7
7
|
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
12
12
|
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
13
13
|
# / __ |/ /_/ / /___/ / /| / / /
|
14
|
-
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
15
15
|
#
|
16
16
|
# This file is part of AdLint.
|
17
17
|
#
|
@@ -38,44 +38,44 @@ module AdLint #:nodoc:
|
|
38
38
|
module Exam #:nodoc:
|
39
39
|
module CBuiltin #:nodoc:
|
40
40
|
|
41
|
-
class
|
41
|
+
class TypeDclExtraction < CodeExtraction
|
42
42
|
def_registrant_phase Cc1::Prepare2Phase
|
43
43
|
|
44
44
|
def initialize(phase_ctxt)
|
45
45
|
super
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
47
|
+
trav.enter_typedef_declaration += T(:extract_typedef_dcl)
|
48
|
+
trav.enter_struct_type_declaration += T(:extract_struct_dcl)
|
49
|
+
trav.enter_union_type_declaration += T(:extract_union_dcl)
|
50
|
+
trav.enter_enum_type_declaration += T(:extract_enum_dcl)
|
51
51
|
end
|
52
52
|
|
53
53
|
private
|
54
54
|
def do_prepare(*) end
|
55
55
|
def do_execute(*) end
|
56
56
|
|
57
|
-
def
|
57
|
+
def extract_typedef_dcl(typedef_dcl)
|
58
58
|
TYPEDCL(typedef_dcl.identifier.location, "T",
|
59
59
|
typedef_dcl.type.name, typedef_dcl.type.image)
|
60
60
|
end
|
61
61
|
|
62
|
-
def
|
62
|
+
def extract_struct_dcl(struct_type_dcl)
|
63
63
|
TYPEDCL(struct_type_dcl.identifier.location, "S",
|
64
64
|
struct_type_dcl.type.name, struct_type_dcl.type.image)
|
65
65
|
end
|
66
66
|
|
67
|
-
def
|
67
|
+
def extract_union_dcl(union_type_dcl)
|
68
68
|
TYPEDCL(union_type_dcl.identifier.location, "U",
|
69
69
|
union_type_dcl.type.name, union_type_dcl.type.image)
|
70
70
|
end
|
71
71
|
|
72
|
-
def
|
72
|
+
def extract_enum_dcl(enum_type_dcl)
|
73
73
|
TYPEDCL(enum_type_dcl.identifier.location, "E",
|
74
74
|
enum_type_dcl.type.name, enum_type_dcl.type.image)
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
class
|
78
|
+
class GVarDclExtraction < CodeExtraction
|
79
79
|
def_registrant_phase Cc1::Prepare2Phase
|
80
80
|
|
81
81
|
def initialize(phase_ctxt)
|
@@ -246,8 +246,8 @@ module CBuiltin #:nodoc:
|
|
246
246
|
|
247
247
|
def initialize(phase_ctxt)
|
248
248
|
super
|
249
|
-
|
250
|
-
|
249
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
250
|
+
trav.enter_generic_labeled_statement += T(:extract)
|
251
251
|
end
|
252
252
|
|
253
253
|
private
|
@@ -264,8 +264,8 @@ module CBuiltin #:nodoc:
|
|
264
264
|
|
265
265
|
def initialize(phase_ctxt)
|
266
266
|
super
|
267
|
-
|
268
|
-
|
267
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
268
|
+
trav.enter_variable_definition += T(:extract)
|
269
269
|
end
|
270
270
|
|
271
271
|
private
|
@@ -285,9 +285,9 @@ module CBuiltin #:nodoc:
|
|
285
285
|
|
286
286
|
def initialize(phase_ctxt)
|
287
287
|
super
|
288
|
-
|
289
|
-
|
290
|
-
|
288
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
289
|
+
trav.enter_simple_assignment_expression += T(:extract)
|
290
|
+
trav.enter_compound_assignment_expression += T(:extract)
|
291
291
|
end
|
292
292
|
|
293
293
|
private
|
@@ -407,8 +407,8 @@ module CBuiltin #:nodoc:
|
|
407
407
|
else
|
408
408
|
referrer = FunctionId.of_ctors_section
|
409
409
|
end
|
410
|
-
|
411
|
-
|
410
|
+
XREF_FUN(expr.location, referrer, "R",
|
411
|
+
FunctionId.new(fun.name, fun.signature.to_s))
|
412
412
|
end
|
413
413
|
end
|
414
414
|
end
|
@@ -418,9 +418,9 @@ module CBuiltin #:nodoc:
|
|
418
418
|
|
419
419
|
def initialize(phase_ctxt)
|
420
420
|
super
|
421
|
-
|
422
|
-
|
423
|
-
|
421
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
422
|
+
trav.enter_constant_specifier += T(:extract_constant)
|
423
|
+
trav.enter_string_literal_specifier += T(:extract_string_literal)
|
424
424
|
end
|
425
425
|
|
426
426
|
private
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Metric measurements (cc1-phase) of adlint-exam-c_builtin package.
|
2
2
|
#
|
3
3
|
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
4
|
-
# Copyright:: Copyright (C) 2010-
|
4
|
+
# Copyright:: Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
5
5
|
# License:: GPLv3+: GNU General Public License version 3 or later
|
6
6
|
#
|
7
7
|
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
12
12
|
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
13
13
|
# / __ |/ /_/ / /___/ / /| / / /
|
14
|
-
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
15
15
|
#
|
16
16
|
# This file is part of AdLint.
|
17
17
|
#
|
@@ -44,24 +44,24 @@ module CBuiltin #:nodoc:
|
|
44
44
|
def initialize(phase_ctxt)
|
45
45
|
super
|
46
46
|
@fpath = phase_ctxt[:sources].first.fpath
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
47
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
48
|
+
trav.enter_error_statement += T(:count_statement)
|
49
|
+
trav.enter_generic_labeled_statement += T(:count_statement)
|
50
|
+
trav.enter_case_labeled_statement += T(:count_statement)
|
51
|
+
trav.enter_default_labeled_statement += T(:count_statement)
|
52
|
+
trav.enter_expression_statement += T(:count_statement)
|
53
|
+
trav.enter_if_statement += T(:count_statement)
|
54
|
+
trav.enter_if_else_statement += T(:count_statement)
|
55
|
+
trav.enter_switch_statement += T(:count_statement)
|
56
|
+
trav.enter_while_statement += T(:count_statement)
|
57
|
+
trav.enter_do_statement += T(:count_statement)
|
58
|
+
trav.enter_for_statement += T(:count_statement)
|
59
|
+
trav.enter_c99_for_statement += T(:count_statement)
|
60
|
+
trav.enter_goto_statement += T(:count_statement)
|
61
|
+
trav.enter_continue_statement += T(:count_statement)
|
62
|
+
trav.enter_break_statement += T(:count_statement)
|
63
|
+
trav.enter_return_statement += T(:count_statement)
|
64
|
+
trav.leave_translation_unit += M(:measure)
|
65
65
|
@stmt_cnt = 0
|
66
66
|
end
|
67
67
|
|
@@ -86,10 +86,10 @@ module CBuiltin #:nodoc:
|
|
86
86
|
def initialize(phase_ctxt)
|
87
87
|
super
|
88
88
|
@fpath = phase_ctxt[:sources].first.fpath
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
89
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
90
|
+
trav.enter_ansi_function_definition += T(:count_function)
|
91
|
+
trav.enter_kandr_function_definition += T(:count_function)
|
92
|
+
trav.leave_translation_unit += M(:measure)
|
93
93
|
@fun_cnt = 0
|
94
94
|
end
|
95
95
|
|
@@ -114,27 +114,27 @@ module CBuiltin #:nodoc:
|
|
114
114
|
def initialize(phase_ctxt)
|
115
115
|
super
|
116
116
|
@fpath = phase_ctxt[:sources].first.fpath
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
117
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
118
|
+
trav.enter_ansi_function_definition += T(:enter_function)
|
119
|
+
trav.leave_ansi_function_definition += T(:leave_function)
|
120
|
+
trav.enter_kandr_function_definition += T(:enter_function)
|
121
|
+
trav.leave_kandr_function_definition += T(:leave_function)
|
122
|
+
trav.enter_error_statement += T(:count_statement)
|
123
|
+
trav.enter_generic_labeled_statement += T(:count_statement)
|
124
|
+
trav.enter_case_labeled_statement += T(:count_statement)
|
125
|
+
trav.enter_default_labeled_statement += T(:count_statement)
|
126
|
+
trav.enter_expression_statement += T(:count_statement)
|
127
|
+
trav.enter_if_statement += T(:count_statement)
|
128
|
+
trav.enter_if_else_statement += T(:count_statement)
|
129
|
+
trav.enter_switch_statement += T(:count_statement)
|
130
|
+
trav.enter_while_statement += T(:count_statement)
|
131
|
+
trav.enter_do_statement += T(:count_statement)
|
132
|
+
trav.enter_for_statement += T(:count_statement)
|
133
|
+
trav.enter_c99_for_statement += T(:count_statement)
|
134
|
+
trav.enter_goto_statement += T(:count_statement)
|
135
|
+
trav.enter_continue_statement += T(:count_statement)
|
136
|
+
trav.enter_break_statement += T(:count_statement)
|
137
|
+
trav.enter_return_statement += T(:count_statement)
|
138
138
|
@cur_fun = nil
|
139
139
|
@stmt_cnt = 0
|
140
140
|
end
|
@@ -144,10 +144,8 @@ module CBuiltin #:nodoc:
|
|
144
144
|
def do_execute(*) end
|
145
145
|
|
146
146
|
def enter_function(fun_def)
|
147
|
-
|
148
|
-
|
149
|
-
@stmt_cnt = 0
|
150
|
-
end
|
147
|
+
@cur_fun = fun_def
|
148
|
+
@stmt_cnt = 0
|
151
149
|
end
|
152
150
|
|
153
151
|
def leave_function(*)
|
@@ -172,27 +170,27 @@ module CBuiltin #:nodoc:
|
|
172
170
|
def initialize(phase_ctxt)
|
173
171
|
super
|
174
172
|
@fpath = phase_ctxt[:sources].first.fpath
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
173
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
174
|
+
trav.enter_ansi_function_definition += T(:enter_function)
|
175
|
+
trav.leave_ansi_function_definition += T(:leave_function)
|
176
|
+
trav.enter_kandr_function_definition += T(:enter_function)
|
177
|
+
trav.leave_kandr_function_definition += T(:leave_function)
|
178
|
+
trav.enter_error_statement += T(:count_statement)
|
179
|
+
trav.enter_generic_labeled_statement += T(:count_statement)
|
180
|
+
trav.enter_case_labeled_statement += T(:count_statement)
|
181
|
+
trav.enter_default_labeled_statement += T(:count_statement)
|
182
|
+
trav.enter_expression_statement += T(:count_statement)
|
183
|
+
trav.enter_if_statement += T(:count_statement)
|
184
|
+
trav.enter_if_else_statement += T(:count_statement)
|
185
|
+
trav.enter_switch_statement += T(:count_statement)
|
186
|
+
trav.enter_while_statement += T(:count_statement)
|
187
|
+
trav.enter_do_statement += T(:count_statement)
|
188
|
+
trav.enter_for_statement += T(:count_statement)
|
189
|
+
trav.enter_c99_for_statement += T(:count_statement)
|
190
|
+
trav.enter_goto_statement += T(:count_statement)
|
191
|
+
trav.enter_continue_statement += T(:count_statement)
|
192
|
+
trav.enter_break_statement += T(:count_statement)
|
193
|
+
trav.enter_return_statement += T(:count_statement)
|
196
194
|
@cur_fun = nil
|
197
195
|
@unreached_stmt_cnt = 0
|
198
196
|
end
|
@@ -202,10 +200,8 @@ module CBuiltin #:nodoc:
|
|
202
200
|
def do_execute(*) end
|
203
201
|
|
204
202
|
def enter_function(fun_def)
|
205
|
-
|
206
|
-
|
207
|
-
@unreached_stmt_cnt = 0
|
208
|
-
end
|
203
|
+
@cur_fun = fun_def
|
204
|
+
@unreached_stmt_cnt = 0
|
209
205
|
end
|
210
206
|
|
211
207
|
def leave_function(*)
|
@@ -231,9 +227,9 @@ module CBuiltin #:nodoc:
|
|
231
227
|
def initialize(phase_ctxt)
|
232
228
|
super
|
233
229
|
@fpath = phase_ctxt[:sources].first.fpath
|
234
|
-
|
235
|
-
|
236
|
-
|
230
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
231
|
+
trav.enter_ansi_function_definition += T(:measure)
|
232
|
+
trav.enter_kandr_function_definition += T(:measure)
|
237
233
|
end
|
238
234
|
|
239
235
|
private
|
@@ -241,11 +237,8 @@ module CBuiltin #:nodoc:
|
|
241
237
|
def do_execute(*) end
|
242
238
|
|
243
239
|
def measure(fun_def)
|
244
|
-
|
245
|
-
|
246
|
-
fun_def.signature.to_s),
|
247
|
-
fun_def.location, fun_def.lines)
|
248
|
-
end
|
240
|
+
FN_LINE(FunctionId.new(fun_def.identifier.value, fun_def.signature.to_s),
|
241
|
+
fun_def.location, fun_def.lines)
|
249
242
|
end
|
250
243
|
end
|
251
244
|
|
@@ -255,9 +248,9 @@ module CBuiltin #:nodoc:
|
|
255
248
|
def initialize(phase_ctxt)
|
256
249
|
super
|
257
250
|
@fpath = phase_ctxt[:sources].first.fpath
|
258
|
-
|
259
|
-
|
260
|
-
|
251
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
252
|
+
trav.enter_ansi_function_definition += T(:measure_ansi_function)
|
253
|
+
trav.enter_kandr_function_definition += T(:measure_kandr_function)
|
261
254
|
end
|
262
255
|
|
263
256
|
private
|
@@ -265,28 +258,23 @@ module CBuiltin #:nodoc:
|
|
265
258
|
def do_execute(*) end
|
266
259
|
|
267
260
|
def measure_ansi_function(fun_def)
|
268
|
-
if
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
fun_def.location, 0)
|
280
|
-
end
|
261
|
+
# TODO: Determine how many parameters if function has va_list.
|
262
|
+
if fun_def.parameter_type_list
|
263
|
+
params = fun_def.parameter_definitions
|
264
|
+
FN_PARA(FunctionId.new(fun_def.identifier.value,
|
265
|
+
fun_def.signature.to_s),
|
266
|
+
fun_def.location, params.count { |param| !param.type.void? })
|
267
|
+
else
|
268
|
+
# TODO: Determine how many parameters if signature is abbreviated.
|
269
|
+
FN_PARA(FunctionId.new(fun_def.identifier.value,
|
270
|
+
fun_def.signature.to_s),
|
271
|
+
fun_def.location, 0)
|
281
272
|
end
|
282
273
|
end
|
283
274
|
|
284
275
|
def measure_kandr_function(fun_def)
|
285
|
-
|
286
|
-
|
287
|
-
fun_def.signature.to_s),
|
288
|
-
fun_def.location, fun_def.identifier_list.size)
|
289
|
-
end
|
276
|
+
FN_PARA(FunctionId.new(fun_def.identifier.value, fun_def.signature.to_s),
|
277
|
+
fun_def.location, fun_def.identifier_list.size)
|
290
278
|
end
|
291
279
|
end
|
292
280
|
|
@@ -313,10 +301,8 @@ module CBuiltin #:nodoc:
|
|
313
301
|
def do_execute(*) end
|
314
302
|
|
315
303
|
def enter_function(fun_def, *)
|
316
|
-
|
317
|
-
|
318
|
-
@vars = {}
|
319
|
-
end
|
304
|
+
@cur_fun = fun_def
|
305
|
+
@vars = {}
|
320
306
|
end
|
321
307
|
|
322
308
|
def leave_function(*)
|
@@ -364,12 +350,12 @@ module CBuiltin #:nodoc:
|
|
364
350
|
def initialize(phase_ctxt)
|
365
351
|
super
|
366
352
|
@fpath = phase_ctxt[:sources].first.fpath
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
353
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
354
|
+
trav.enter_ansi_function_definition += T(:enter_function)
|
355
|
+
trav.leave_ansi_function_definition += T(:leave_function)
|
356
|
+
trav.enter_kandr_function_definition += T(:enter_function)
|
357
|
+
trav.leave_kandr_function_definition += T(:leave_function)
|
358
|
+
trav.enter_function_call_expression += T(:count_function_call)
|
373
359
|
@cur_fun = nil
|
374
360
|
@funcall_cnt = 0
|
375
361
|
end
|
@@ -379,10 +365,8 @@ module CBuiltin #:nodoc:
|
|
379
365
|
def do_execute(*) end
|
380
366
|
|
381
367
|
def enter_function(fun_def)
|
382
|
-
|
383
|
-
|
384
|
-
@funcall_cnt = 0
|
385
|
-
end
|
368
|
+
@cur_fun = fun_def
|
369
|
+
@funcall_cnt = 0
|
386
370
|
end
|
387
371
|
|
388
372
|
def leave_function(*)
|
@@ -408,12 +392,12 @@ module CBuiltin #:nodoc:
|
|
408
392
|
def initialize(phase_ctxt)
|
409
393
|
super
|
410
394
|
@fpath = phase_ctxt[:sources].first.fpath
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
395
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
396
|
+
trav.enter_ansi_function_definition += T(:enter_function)
|
397
|
+
trav.leave_ansi_function_definition += T(:leave_function)
|
398
|
+
trav.enter_kandr_function_definition += T(:enter_function)
|
399
|
+
trav.leave_kandr_function_definition += T(:leave_function)
|
400
|
+
trav.enter_goto_statement += T(:count_goto)
|
417
401
|
@cur_fun = nil
|
418
402
|
@goto_cnt = 0
|
419
403
|
end
|
@@ -423,10 +407,8 @@ module CBuiltin #:nodoc:
|
|
423
407
|
def do_execute(*) end
|
424
408
|
|
425
409
|
def enter_function(fun_def)
|
426
|
-
|
427
|
-
|
428
|
-
@goto_cnt = 0
|
429
|
-
end
|
410
|
+
@cur_fun = fun_def
|
411
|
+
@goto_cnt = 0
|
430
412
|
end
|
431
413
|
|
432
414
|
def leave_function(*)
|
@@ -452,27 +434,27 @@ module CBuiltin #:nodoc:
|
|
452
434
|
def initialize(phase_ctxt)
|
453
435
|
super
|
454
436
|
@fpath = phase_ctxt[:sources].first.fpath
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
437
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
438
|
+
trav.enter_ansi_function_definition += T(:enter_function)
|
439
|
+
trav.leave_ansi_function_definition += T(:leave_function)
|
440
|
+
trav.enter_kandr_function_definition += T(:enter_function)
|
441
|
+
trav.leave_kandr_function_definition += T(:leave_function)
|
442
|
+
trav.enter_error_statement += T(:enter_statement)
|
443
|
+
trav.enter_generic_labeled_statement += T(:enter_statement)
|
444
|
+
trav.enter_case_labeled_statement += T(:enter_statement)
|
445
|
+
trav.enter_default_labeled_statement += T(:enter_statement)
|
446
|
+
trav.enter_expression_statement += T(:enter_statement)
|
447
|
+
trav.enter_if_statement += T(:enter_statement)
|
448
|
+
trav.enter_if_else_statement += T(:enter_statement)
|
449
|
+
trav.enter_switch_statement += T(:enter_statement)
|
450
|
+
trav.enter_while_statement += T(:enter_statement)
|
451
|
+
trav.enter_do_statement += T(:enter_statement)
|
452
|
+
trav.enter_for_statement += T(:enter_statement)
|
453
|
+
trav.enter_c99_for_statement += T(:enter_statement)
|
454
|
+
trav.enter_goto_statement += T(:enter_statement)
|
455
|
+
trav.enter_continue_statement += T(:enter_statement)
|
456
|
+
trav.enter_break_statement += T(:enter_statement)
|
457
|
+
trav.enter_return_statement += T(:count_return)
|
476
458
|
@cur_fun = nil
|
477
459
|
@ret_cnt = 0
|
478
460
|
@lst_stmt = nil
|
@@ -483,11 +465,9 @@ module CBuiltin #:nodoc:
|
|
483
465
|
def do_execute(*) end
|
484
466
|
|
485
467
|
def enter_function(fun_def)
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
@lst_stmt = nil
|
490
|
-
end
|
468
|
+
@cur_fun = fun_def
|
469
|
+
@ret_cnt = 0
|
470
|
+
@lst_stmt = nil
|
491
471
|
end
|
492
472
|
|
493
473
|
def leave_function(*)
|
@@ -528,13 +508,13 @@ module CBuiltin #:nodoc:
|
|
528
508
|
def initialize(phase_ctxt)
|
529
509
|
super
|
530
510
|
@fpath = phase_ctxt[:sources].first.fpath
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
511
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
512
|
+
trav.enter_ansi_function_definition += T(:enter_function)
|
513
|
+
trav.leave_ansi_function_definition += T(:leave_function)
|
514
|
+
trav.enter_kandr_function_definition += T(:enter_function)
|
515
|
+
trav.leave_kandr_function_definition += T(:leave_function)
|
516
|
+
trav.enter_if_else_statement += T(:enter_if_else_statement)
|
517
|
+
trav.leave_if_else_statement += T(:leave_if_else_statement)
|
538
518
|
@cur_fun = nil
|
539
519
|
@if_else_stmt_chain = 0
|
540
520
|
@incomplete_if_else_stmt_cnt = 0
|
@@ -545,11 +525,9 @@ module CBuiltin #:nodoc:
|
|
545
525
|
def do_execute(*) end
|
546
526
|
|
547
527
|
def enter_function(fun_def)
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
@incomplete_if_else_stmt_cnt = 0
|
552
|
-
end
|
528
|
+
@cur_fun = fun_def
|
529
|
+
@if_else_stmt_chain = 0
|
530
|
+
@incomplete_if_else_stmt_cnt = 0
|
553
531
|
end
|
554
532
|
|
555
533
|
def leave_function(*)
|
@@ -584,19 +562,19 @@ module CBuiltin #:nodoc:
|
|
584
562
|
def initialize(phase_ctxt)
|
585
563
|
super
|
586
564
|
@fpath = phase_ctxt[:sources].first.fpath
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
565
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
566
|
+
trav.enter_ansi_function_definition += T(:enter_function)
|
567
|
+
trav.leave_ansi_function_definition += T(:leave_function)
|
568
|
+
trav.enter_kandr_function_definition += T(:enter_function)
|
569
|
+
trav.leave_kandr_function_definition += T(:leave_function)
|
570
|
+
trav.enter_compound_statement += T(:enter_block)
|
571
|
+
trav.leave_compound_statement += T(:leave_block)
|
572
|
+
trav.enter_if_statement += T(:check_statement)
|
573
|
+
trav.enter_if_else_statement += T(:check_statement)
|
574
|
+
trav.enter_while_statement += T(:check_statement)
|
575
|
+
trav.enter_do_statement += T(:check_statement)
|
576
|
+
trav.enter_for_statement += T(:check_statement)
|
577
|
+
trav.enter_c99_for_statement += T(:check_statement)
|
600
578
|
@cur_fun = nil
|
601
579
|
end
|
602
580
|
|
@@ -605,13 +583,11 @@ module CBuiltin #:nodoc:
|
|
605
583
|
def do_execute(*) end
|
606
584
|
|
607
585
|
def enter_function(fun_def)
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
@max_nest_level = @cur_nest_level = -1
|
614
|
-
end
|
586
|
+
@cur_fun = fun_def
|
587
|
+
# NOTE: Nest level of the top of the function is 0.
|
588
|
+
# Function definition must have a compound-statement as the
|
589
|
+
# function body.
|
590
|
+
@max_nest_level = @cur_nest_level = -1
|
615
591
|
end
|
616
592
|
|
617
593
|
def leave_function(fun_def)
|
@@ -682,18 +658,15 @@ module CBuiltin #:nodoc:
|
|
682
658
|
def do_execute(*) end
|
683
659
|
|
684
660
|
def enter_function(fun_def, *)
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
# NOTE: Stack of the number of paths in the current branch group.
|
695
|
-
@paths_in_branch_group = [@paths_in_fun]
|
696
|
-
end
|
661
|
+
@cur_fun = fun_def
|
662
|
+
# NOTE: Number of paths in the current function.
|
663
|
+
@paths_in_fun = 1
|
664
|
+
# NOTE: Stack of the number of paths to enter the current branch group.
|
665
|
+
@paths_to_enter_branch_group = [@paths_in_fun]
|
666
|
+
# NOTE: Stack of the number of paths in the current branch.
|
667
|
+
@paths_in_branch = [@paths_in_fun]
|
668
|
+
# NOTE: Stack of the number of paths in the current branch group.
|
669
|
+
@paths_in_branch_group = [@paths_in_fun]
|
697
670
|
end
|
698
671
|
|
699
672
|
def leave_function(*)
|
@@ -752,14 +725,14 @@ module CBuiltin #:nodoc:
|
|
752
725
|
def initialize(phase_ctxt)
|
753
726
|
super
|
754
727
|
@fpath = phase_ctxt[:sources].first.fpath
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
728
|
+
trav = phase_ctxt[:cc1_ast_traversal]
|
729
|
+
trav.enter_ansi_function_definition += T(:enter_function)
|
730
|
+
trav.leave_ansi_function_definition += T(:leave_function)
|
731
|
+
trav.enter_kandr_function_definition += T(:enter_function)
|
732
|
+
trav.leave_kandr_function_definition += T(:leave_function)
|
733
|
+
trav.enter_if_statement += T(:enter_selection)
|
734
|
+
trav.enter_if_else_statement += T(:enter_selection)
|
735
|
+
trav.enter_case_labeled_statement += T(:enter_selection)
|
763
736
|
@cur_fun = nil
|
764
737
|
@cycl_compl = 0
|
765
738
|
end
|
@@ -769,10 +742,8 @@ module CBuiltin #:nodoc:
|
|
769
742
|
def do_execute(*) end
|
770
743
|
|
771
744
|
def enter_function(fun_def)
|
772
|
-
|
773
|
-
|
774
|
-
@cycl_compl = 0
|
775
|
-
end
|
745
|
+
@cur_fun = fun_def
|
746
|
+
@cycl_compl = 0
|
776
747
|
end
|
777
748
|
|
778
749
|
def leave_function(*)
|