]> granicus.if.org Git - php/commitdiff
fixed "unused function" compilation warning
authorDmitry Stogov <dmitry@zend.com>
Mon, 18 Dec 2017 08:43:12 +0000 (11:43 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 18 Dec 2017 08:43:12 +0000 (11:43 +0300)
Zend/zend_vm_execute.h
Zend/zend_vm_gen.php

index 8990bcd31d3183847399bfdb5c971ba175b2fbb5..b729a31906ece940f9ce354e88b5167b712cecea 100644 (file)
@@ -323,7 +323,9 @@ static int zend_handlers_count;
 static const void * const * zend_opcode_handler_funcs;
 static zend_op hybrid_halt_op;
 #endif
+#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID)
 static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);
+#endif
 
 #if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
 static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);
@@ -67695,10 +67697,12 @@ static const void *zend_vm_get_opcode_handler_ex(uint32_t spec, const zend_op* o
        return zend_opcode_handlers[(spec & SPEC_START_MASK) + offset];
 }
 
+#if ZEND_VM_KIND != ZEND_VM_KIND_HYBRID
 static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)
 {
        return zend_vm_get_opcode_handler_ex(zend_spec_handlers[opcode], op);
 }
+#endif
 
 #if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID
 static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op)
index 67a4aa0048757beb5d67a84a489fb0a0881e6ab8..4f4ad4c7b2ce837f0f4f2433c73c5c50ae4f693d 100644 (file)
@@ -1638,7 +1638,9 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
                                                out($f,"static zend_op hybrid_halt_op;\n");
                                                out($f,"#endif\n");
                                        }
-                                       out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n\n");
+                                       out($f,"#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID)\n");
+                                       out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n");
+                                       out($f,"#endif\n\n");
                                        if ($kind == ZEND_VM_KIND_HYBRID) {
                                                out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
                                                out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);\n");
@@ -2501,6 +2503,7 @@ function gen_vm($def, $skel) {
                out($f, "\treturn zend_opcode_handlers[(spec & SPEC_START_MASK) + offset];\n");
        }
        out($f, "}\n\n");
+       out($f, "#if ZEND_VM_KIND != ZEND_VM_KIND_HYBRID\n");
        out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n");
        out($f, "{\n");
        if (!ZEND_VM_SPEC) {
@@ -2508,7 +2511,8 @@ function gen_vm($def, $skel) {
        } else {
                out($f, "\treturn zend_vm_get_opcode_handler_ex(zend_spec_handlers[opcode], op);\n");
        }
-       out($f, "}\n\n");
+       out($f, "}\n");
+       out($f, "#endif\n\n");
 
        if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) {
                // Generate zend_vm_get_opcode_handler_func() function