Use builtin_trap() for CRASH when building with clang
https://bugs.webkit.org/show_bug.cgi?id=66152
Reviewed by Anders Carlsson.
../JavaScriptCore:
Add Clang specific CRASH macro that calls builtin_trap() instead
of silly techniques to crash. This allows the static analyzer to understand
that we are intentionally crashing. As a result, we need to mark some functions
as not returning.
Also adds a macros that annotates a function as never returning due to ASSERT or CRASH.
Add COMPILIER(CLANG) and fix some formatting and spelling mistakes.
(WTF::Internal::fastMallocMatchFailed):
Add NO_RETURN_DUE_TO_CRASH.
(JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
Add NO_RETURN_DUE_TO_ASSERT.
../WebCore:
- bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneBase::fail):
- bindings/objc/WebScriptObject.mm:
- platform/mac/BlockExceptions.h:
- platform/text/cf/StringImplCF.cpp:
Add NO_RETURN_DUE_TO_ASSERT.
Don't define the destructor since it is never called,
../WebKit/mac:
- Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView setAttributeKeys:andValues:]):
(-[WebBaseNetscapePluginView handleMouseMoved:]):
(-[WebBaseNetscapePluginView handleMouseEntered:]):
(-[WebBaseNetscapePluginView handleMouseExited:]):
(-[WebBaseNetscapePluginView focusChanged]):
(-[WebBaseNetscapePluginView windowFocusChanged:]):
(-[WebBaseNetscapePluginView createPlugin]):
(-[WebBaseNetscapePluginView loadStream]):
(-[WebBaseNetscapePluginView shouldStop]):
(-[WebBaseNetscapePluginView destroyPlugin]):
(-[WebBaseNetscapePluginView updateAndSetWindow]):
(-[WebBaseNetscapePluginView sendModifierEventWithKeyCode:character:]):
(-[WebBaseNetscapePluginView pluginLayer]):
(-[WebBaseNetscapePluginView getFormValue:]):
Remove the ASSERT_NOT_REACHED from the base class methods. They were not
adding much value and were getting in the way of making the static analyzer
work. A better way to do this would be to use a formal protocol.