зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1570499 - Part 2: Suppress -Wimplicit-fallthrough warnings from third-party udis86 code. r=froydnj
ProcessRedirect.cpp includes third-party udis86 C code that triggers -Wimplicit-fallthrough warnings. We suppress these warnings in ProcessRedirect.cpp because we want to minimize Mozilla changes to third-party code and we can't use C++17's [[fallthrough]] attribute in C code anyway. We don't suppress the warnings for the entire ProcessRedirect.cpp file (e.g. in moz.build) because we'd like clang -Wimplicit-fallthrough to check ProcessRedirect.cpp's own use of [[fallthrough]]. This changeset reverts some earlier Mozilla changes [1] made to upstream udis86's decode.c [2] that are no longer necessary. [1] https://hg.mozilla.org/mozilla-central/rev/9042673fb235c00fbb021ea6356f4b0921505d1d [2] https://github.com/vmt/udis86/blob/master/libudis86/decode.c#L747 Differential Revision: https://phabricator.services.mozilla.com/D56441 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
406763af7f
Коммит
03b2377b75
|
@ -15,6 +15,11 @@
|
|||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wimplicit-fallthrough"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
#include "udis86/udis86.c"
|
||||
|
@ -23,6 +28,10 @@ namespace {
|
|||
|
||||
} // anonymous namespace
|
||||
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace recordreplay {
|
||||
|
||||
|
|
|
@ -648,12 +648,12 @@ decode_operand(struct ud *u,
|
|||
break;
|
||||
case OP_F:
|
||||
u->br_far = 1;
|
||||
MOZ_FALLTHROUGH;
|
||||
/* intended fall through */
|
||||
case OP_M:
|
||||
if (MODRM_MOD(modrm(u)) == 3) {
|
||||
UDERR(u, "expected modrm.mod != 3\n");
|
||||
}
|
||||
MOZ_FALLTHROUGH;
|
||||
/* intended fall through */
|
||||
case OP_E:
|
||||
decode_modrm_rm(u, operand, REGCLASS_GPR, size);
|
||||
break;
|
||||
|
@ -672,7 +672,7 @@ decode_operand(struct ud *u,
|
|||
if (MODRM_MOD(modrm(u)) != 3) {
|
||||
UDERR(u, "expected modrm.mod == 3\n");
|
||||
}
|
||||
MOZ_FALLTHROUGH;
|
||||
/* intended fall through */
|
||||
case OP_Q:
|
||||
decode_modrm_rm(u, operand, REGCLASS_MMX, size);
|
||||
break;
|
||||
|
@ -683,7 +683,7 @@ decode_operand(struct ud *u,
|
|||
if (MODRM_MOD(modrm(u)) != 3) {
|
||||
UDERR(u, "expected modrm.mod == 3\n");
|
||||
}
|
||||
MOZ_FALLTHROUGH;
|
||||
/* intended fall through */
|
||||
case OP_W:
|
||||
decode_modrm_rm(u, operand, REGCLASS_XMM, size);
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче