Chromium Code Reviews| Index: lib/compiler/implementation/ssa/codegen.dart |
| diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart |
| index f68eedea1faed2849d015a57aa7f258300eda6ed..ec02d39175ffeeef51e0e8c3c95a636213acb607 100644 |
| --- a/lib/compiler/implementation/ssa/codegen.dart |
| +++ b/lib/compiler/implementation/ssa/codegen.dart |
| @@ -27,6 +27,15 @@ class SsaCodeGeneratorTask extends CompilerTask { |
| CodeBuffer generateMethod(WorkItem work, HGraph graph) { |
| return measure(() { |
| + HTypeMap types = work.compilationContext.types; |
| + graph.exit.predecessors.forEach((block) { |
| + assert(block.last is HGoto || block.last is HReturn); |
| + if (block.last is HReturn) { |
|
ngeoffray
2012/08/17 10:02:51
How about a function with multiple return?
Søren Gjesse
2012/08/17 10:08:54
This should be handled by the
graph.exit.predeces
ngeoffray
2012/08/17 10:13:29
Hmm, a HReturn block has the HExit block as a succ
Søren Gjesse
2012/08/17 10:21:04
I checked the (3) places where HReturn nodes are c
|
| + backend.registerReturnType(work.element, types[block.last.inputs[0]]); |
| + } else { |
| + backend.registerReturnType(work.element, HType.NULL); |
| + } |
| + }); |
| compiler.tracer.traceGraph("codegen", graph); |
| Map<Element, String> parameterNames = getParameterNames(work); |
| parameterNames.forEach((element, name) { |