• Clemens Hammacher's avatar
    [presubmit] Add check for unbalanced #define / #undef · b8cc63ee
    Clemens Hammacher authored
    With jumbo builds, we get spurious errors if several .cc files define
    the same preprocessor macro without undefining it. This is also
    disallowed by the style guide.
    This patch adds a presubmit check to check that each #define is
    eventually followed by a corresponding #undef. Special care has to be
    taken for conditionally defined macros. Here, the logic to check that
    there are not multiple defines and that they are undefined in all
    cases is not perfect; it's optimistic in order to avoid false positives.
    
    R=mstarzinger@chromium.org, machenbach@chromium.org
    
    Bug: v8:6811
    Change-Id: I55cde499399d97a5eb02fbc5ecfa34e6a8099d06
    Reviewed-on: https://chromium-review.googlesource.com/657104
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
    Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#47944}
    b8cc63ee
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...