diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2014-08-05 14:11:16 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2014-08-13 12:53:19 +0200 |
commit | 2fea3d1899eb8cc81920b631ea73a1f130674950 (patch) | |
tree | 5e115b5fa3597b96b21176578aa1f741c76163f2 /src/qml/compiler/qv4ssa.cpp | |
parent | d6a79aa6b06726d19d231d1da3ecb5b6509f0f1a (diff) |
V4 IR: change IR printing to be more readable.
New structure:
- "comments" now start with a semi-colon, and have a list of key: values.
; predecessors: L17 L26 L36, loop_header: yes
; line: 30, column: 3
- when a temporary has a known type, it is written in front of the
teporary when it is being assigned, and not repeated.
var %109 = this
double %42 = 42
- an expression starts with the operation, followed by the operands that
are separated by commas. The type of the operands is the type
mentioned when they are assigned.
int32 %115 = sub %184, %185
if gt %27, 0 goto L40 else goto L41
- conversions do mention the operand type in order to make them easier
to read.
double %178 = convert var to double %60
- phi node operands are prefixed by the from-label to make it easy to
match those operands with the from-block.
double %62 = phi L35: %58, L34: %61
- all names except for "this" and built-ins are prefixed by a dot in
order to make it clear that a lookup will occur, just like member
accesses.
$6 = call .int2char($0)
%7 = this
%8 = %7.toString()
Change-Id: I9f626a91f97ca7c3f27e01a5539f3c4fc10a46b4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4ssa.cpp')
-rw-r--r-- | src/qml/compiler/qv4ssa.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index 8c5f2e30bb..9a597952eb 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -81,8 +81,10 @@ Q_GLOBAL_STATIC_WITH_ARGS(QTextStream, qout, (stderr, QIODevice::WriteOnly)); void showMeTheCode(IR::Function *function) { static bool showCode = !qgetenv("QV4_SHOW_IR").isNull(); - if (showCode) + if (showCode) { IRPrinter(&qout).print(function); + qout << endl; + } } class ProcessedBlocks @@ -1659,7 +1661,7 @@ class StatementWorklist public: StatementWorklist(IR::Function *function) : theFunction(function) - , stmts(function->statementCount(), 0) + , stmts(function->statementCount(), static_cast<Stmt *>(0)) , worklist(function->statementCount(), false) , worklistSize(0) , replaced(function->statementCount(), Stmt::InvalidId) |