JavaScriptCore: Enable -Wimplicit-fallthrough and add FALLTHROUGH annotation where needed
https://bugs.webkit.org/show_bug.cgi?id=127647
Reviewed by Anders Carlsson.
Explicitly annotate switch case fallthroughs in JavaScriptCore and
enable warnings for unannotated fallthroughs.
(doesOverflow):
Only insert FALLTHROUGH in release builds. In debug builds, the
FALLTHROUGH would be unreachable (due to the ASSERT_NOT_REACHED)
and would through a warning.
- dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt52):
Due to the templatized nature of this function, a fallthrough
in one of the template expansions would be unreachable. Disable
the warning for this function.
- Configurations/Base.xcconfig:
- bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
- dfg/DFGCFGSimplificationPhase.cpp:
(JSC::DFG::CFGSimplificationPhase::run):
(JSC::DFG::Validate::validateCPS):
(JSC::Lexer<T>::lex):
(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::parseProperty):
(JSC::JSArray::push):
(JSC::Walker::walk):
(JSC::JSObject::putByIndex):
(JSC::JSObject::putByIndexBeyondVectorLength):
(JSC::JSObject::setIndexQuickly):
(JSC::JSObject::initializeIndex):
- runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::parse):
- yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
(JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
(JSC::Yarr::Parser::parseEscape):
(JSC::Yarr::Parser::parseTokens):