summaryrefslogtreecommitdiff
path: root/src/qml/compiler/qv4bytecodehandler_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2019-01-10 13:42:42 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2019-02-01 14:07:23 +0000
commitad8e47f5181fd8240645282abbc671812a9f4fa8 (patch)
treecdd5da6824bca8e84e860d5f91d3e812bdf16e9a /src/qml/compiler/qv4bytecodehandler_p.h
parent3254ac322be96ad0ee5efd3d0728be03d8be34da (diff)
downloadqtdeclarative-ad8e47f5181fd8240645282abbc671812a9f4fa8.tar.gz
V4: Change ByteCodeHandler::startInstruction to return an enum
If ProcessInstruction is returned, the generate_* function and endInstruction will be called. If SkipInstruction is returned, they won't be called. This can be used by subclasses that can detect dead code, to suppress handling that code. Change-Id: I3b4a8eebb5701f287c8199bd40bc63fe04a35007 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4bytecodehandler_p.h')
-rw-r--r--src/qml/compiler/qv4bytecodehandler_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4bytecodehandler_p.h b/src/qml/compiler/qv4bytecodehandler_p.h
index 797d25b8d0..f1e7c99447 100644
--- a/src/qml/compiler/qv4bytecodehandler_p.h
+++ b/src/qml/compiler/qv4bytecodehandler_p.h
@@ -105,7 +105,8 @@ public:
protected:
FOR_EACH_MOTH_INSTR(BYTECODE_HANDLER_DEFINE_VIRTUAL_BYTECODE_HANDLER)
- virtual void startInstruction(Moth::Instr::Type instr) = 0;
+ enum Verdict { ProcessInstruction, SkipInstruction };
+ virtual Verdict startInstruction(Moth::Instr::Type instr) = 0;
virtual void endInstruction(Moth::Instr::Type instr) = 0;
private: