Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/typesystem/TypeSystemCodeGenerator.java @ 8252:0905d796944a
Refactored codegen error model to make error redirection a lot easier.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 13 Mar 2013 19:58:28 +0100 |
parents | bdcb3cc47e16 |
children | 89006c76f737 |
comparison
equal
deleted
inserted
replaced
8251:cb70ed101b5f | 8252:0905d796944a |
---|---|
165 private CodeExecutableElement createGetTopType(TypeSystemData typeSystem) { | 165 private CodeExecutableElement createGetTopType(TypeSystemData typeSystem) { |
166 CodeExecutableElement method = new CodeExecutableElement(modifiers(PUBLIC), getContext().getType(Class.class), "getTopType"); | 166 CodeExecutableElement method = new CodeExecutableElement(modifiers(PUBLIC), getContext().getType(Class.class), "getTopType"); |
167 | 167 |
168 CodeTreeBuilder builder = method.createBuilder(); | 168 CodeTreeBuilder builder = method.createBuilder(); |
169 builder.startReturn(); | 169 builder.startReturn(); |
170 if (typeSystem.getTypes().length > 0) { | 170 if (!typeSystem.getTypes().isEmpty()) { |
171 builder.typeLiteral(typeSystem.getTypes()[0].getBoxedType()); | 171 builder.typeLiteral(typeSystem.getTypes().get(0).getBoxedType()); |
172 } else { | 172 } else { |
173 builder.null_(); | 173 builder.null_(); |
174 } | 174 } |
175 builder.end(); // return | 175 builder.end(); // return |
176 | 176 |