Add a Q_UNREACHABLE to improve code generation a little
authorThiago Macieira <thiago.macieira@intel.com>
Sun, 26 Aug 2012 15:32:08 +0000 (17:32 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 13 Sep 2012 17:52:55 +0000 (19:52 +0200)
The code can't reach there anyway, so let's help the compiler out a
little.

Change-Id: Icee6ebe426c1116a7baaf2c5766c6d8f8276f3ac
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
src/qml/qml/qqmlcompileddata.cpp
src/qml/qml/qqmlvme.cpp

index c2ca079..4b8e9ff 100644 (file)
@@ -223,6 +223,7 @@ QQmlInstruction::Type QQmlCompiledData::instructionType(const QQmlInstruction *i
         return QQmlInstruction::I;
 
     FOR_EACH_QML_INSTR(QML_CHECK_INSTR_CODE)
+    Q_UNREACHABLE();
     Q_ASSERT_X(false, Q_FUNC_INFO, "Invalid instruction address");
     return static_cast<QQmlInstruction::Type>(0);
 #  undef QML_CHECK_INSTR_CODE
index 9b550c5..2f7c9c2 100644 (file)
@@ -1085,6 +1085,7 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
     // nothing to do
 #else
         default:
+            Q_UNREACHABLE();
             qFatal("QQmlCompiledData: Internal error - unknown instruction %d", genericInstr->common.instructionType);
             break;
         }