OSDN Git Service

[Support/Compiler.h] - Use gnu::fallthrough for LLVM_FALLTHROUGH when available.
authorGeorge Rimar <grimar@accesssoftek.com>
Fri, 12 May 2017 06:53:48 +0000 (06:53 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Fri, 12 May 2017 06:53:48 +0000 (06:53 +0000)
commitb62f430846b071c9fda2aa51dd8e3f55d42ee657
treebfffad14685125d2ccabb1605e49f5e568930348
parent668e541eeda0155667962f0c00d9ccb8c09113b3
[Support/Compiler.h] - Use gnu::fallthrough for LLVM_FALLTHROUGH when available.

I tried to compile LLD using GCC 7.1.0 and got warnings like
"warning: this statement may fall through [-Wimplicit-fallthrough=]"
(some more details are here: D32907)

GCC's __cplusplus value is 201402L by default, so macro expands to nothing,
though GCC 7 has support for [[fallthrough]].

Patch uses gnu::fallthrough when it is available and fixes warning I am observing.

Initial idea of way to fix belongs to Davide Italiano.

Differential revision: https://reviews.llvm.org/D33036

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302878 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/Compiler.h