Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTreeBuilder.java @ 18605:58eb9bbb60c4
Truffle-DSL: fixed several bugs when using arrays as type. added arrays test.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 03 Dec 2014 21:02:27 +0100 |
parents | 93e061157811 |
children | 3912400fc33a |
comparison
equal
deleted
inserted
replaced
18604:39441c10d314 | 18605:58eb9bbb60c4 |
---|---|
670 public CodeTreeBuilder instanceOf(String var, String type) { | 670 public CodeTreeBuilder instanceOf(String var, String type) { |
671 return instanceOf(singleString(var), singleString(type)); | 671 return instanceOf(singleString(var), singleString(type)); |
672 } | 672 } |
673 | 673 |
674 public CodeTreeBuilder instanceOf(String var, TypeMirror type) { | 674 public CodeTreeBuilder instanceOf(String var, TypeMirror type) { |
675 TypeElement element = ElementUtils.fromTypeMirror(type); | |
676 if (element == null) { | |
677 throw new IllegalArgumentException("Cannot call instanceof for a non supported type: " + type.getKind()); | |
678 } | |
679 return instanceOf(singleString(var), singleType(type)); | 675 return instanceOf(singleString(var), singleType(type)); |
680 } | 676 } |
681 | 677 |
682 public CodeTreeBuilder defaultValue(TypeMirror mirror) { | 678 public CodeTreeBuilder defaultValue(TypeMirror mirror) { |
683 switch (mirror.getKind()) { | 679 switch (mirror.getKind()) { |