https://bugs.webkit.org/show_bug.cgi?id=170501
Reviewed by Keith Miller.
Source/JavaScriptCore:
Should use ASSERT_NOT_REACHED since return-type pragma is only
enabled under ASSERT_DISABLED environment. We shoud use
ASSERT_NOTREACHED to emit assertions in debug build. It effectively
catches bugs while keeping performance in release build.
* b3/B3Opcode.cpp:
(JSC::B3::storeOpcode):
* b3/B3Width.h:
(JSC::B3::mask):
* runtime/Options.cpp:
(JSC::parse):
* wasm/WasmSections.h:
(JSC::Wasm::makeString):
* wasm/WasmSignature.cpp:
(JSC::Wasm::SignatureInformation::tryCleanup):
* wasm/generateWasmValidateInlinesHeader.py:
Source/WTF:
Add a new macro UNUSED_FUNCTION to annotate unused static functions.
#pragma GCC diagnostic ignored "-Wunused-function" does not work.
* wtf/Compiler.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214942
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-04-05 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ [JSC] Suppress warnings in GCC
+ https://bugs.webkit.org/show_bug.cgi?id=170501
+
+ Reviewed by Keith Miller.
+
+ Should use ASSERT_NOT_REACHED since return-type pragma is only
+ enabled under ASSERT_DISABLED environment. We shoud use
+ ASSERT_NOTREACHED to emit assertions in debug build. It effectively
+ catches bugs while keeping performance in release build.
+
+ * b3/B3Opcode.cpp:
+ (JSC::B3::storeOpcode):
+ * b3/B3Width.h:
+ (JSC::B3::mask):
+ * runtime/Options.cpp:
+ (JSC::parse):
+ * wasm/WasmSections.h:
+ (JSC::Wasm::makeString):
+ * wasm/WasmSignature.cpp:
+ (JSC::Wasm::SignatureInformation::tryCleanup):
+ * wasm/generateWasmValidateInlinesHeader.py:
+
2017-04-05 Carlos Garcia Campos <cgarcia@igalia.com>
Implement PromiseDeferredTimer for non CF based ports
case FP:
return Store;
}
+ ASSERT_NOT_REACHED();
}
} } // namespace JSC::B3
case Width64:
return 0xffffffffffffffffllu;
}
+ ASSERT_NOT_REACHED();
}
} } // namespace JSC::B3
return sscanf(string, "%u", &value) == 1;
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-function"
static bool parse(const char* string, unsigned long& value)
{
return sscanf(string, "%lu", &value);
}
-static bool parse(const char* string, unsigned long long& value)
+static bool UNUSED_FUNCTION parse(const char* string, unsigned long long& value)
{
return sscanf(string, "%llu", &value);
}
-#pragma GCC diagnostic pop
static bool parse(const char* string, double& value)
{
FOR_EACH_WASM_SECTION(STRINGIFY_SECTION_NAME)
#undef STRINGIFY_SECTION_NAME
}
+ ASSERT_NOT_REACHED();
}
} } // namespace JSC::Wasm
}
for (const auto& pair : toRemove) {
bool removed = info.m_signatureMap.remove(SignatureHash { pair.second });
- ASSERT(removed);
+ ASSERT_UNUSED(removed, removed);
removed = info.m_indexMap.remove(pair.first);
- ASSERT(removed);
+ ASSERT_UNUSED(removed, removed);
}
if (info.m_signatureMap.isEmpty()) {
ASSERT(info.m_indexMap.isEmpty());
switch (op) {
""" + loadCases + """
}
+ ASSERT_NOT_REACHED();
}
auto Validate::store(StoreOpType op, ExpressionType pointer, ExpressionType value, uint32_t) -> Result
switch (op) {
""" + storeCases + """
}
+ ASSERT_NOT_REACHED();
}
} } // namespace JSC::Wasm
+2017-04-05 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ [JSC] Suppress warnings in GCC
+ https://bugs.webkit.org/show_bug.cgi?id=170501
+
+ Reviewed by Keith Miller.
+
+ Add a new macro UNUSED_FUNCTION to annotate unused static functions.
+ #pragma GCC diagnostic ignored "-Wunused-function" does not work.
+
+ * wtf/Compiler.h:
+
2017-04-04 Filip Pizlo <fpizlo@apple.com>
Air::eliminateDeadCode() should not use a HashSet
#define PURE_FUNCTION
#endif
+/* UNUSED_FUNCTION */
+
+#if !defined(UNUSED_FUNCTION) && COMPILER(GCC_OR_CLANG)
+#define UNUSED_FUNCTION __attribute__((unused))
+#endif
+
+#if !defined(UNUSED_FUNCTION)
+#define UNUSED_FUNCTION
+#endif
+
/* REFERENCED_FROM_ASM */
#if !defined(REFERENCED_FROM_ASM) && COMPILER(GCC_OR_CLANG)