Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java @ 16789:7977cb9fa21f
Truffle-DSL: fixed a bug in ElementUtils#getType.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 12 Aug 2014 17:45:03 +0200 |
parents | 45c8f64978d6 |
children | 7eeae4545685 |
comparison
equal
deleted
inserted
replaced
16788:cf71dd00db68 | 16789:7977cb9fa21f |
---|---|
41 public class ElementUtils { | 41 public class ElementUtils { |
42 | 42 |
43 public static TypeMirror getType(ProcessingEnvironment processingEnv, Class<?> element) { | 43 public static TypeMirror getType(ProcessingEnvironment processingEnv, Class<?> element) { |
44 TypeMirror mirror; | 44 TypeMirror mirror; |
45 if (element.isPrimitive()) { | 45 if (element.isPrimitive()) { |
46 if (element == void.class) { | |
47 return processingEnv.getTypeUtils().getNoType(TypeKind.VOID); | |
48 } | |
46 TypeKind typeKind; | 49 TypeKind typeKind; |
47 if (element == boolean.class) { | 50 if (element == boolean.class) { |
48 typeKind = TypeKind.BOOLEAN; | 51 typeKind = TypeKind.BOOLEAN; |
49 } else if (element == byte.class) { | 52 } else if (element == byte.class) { |
50 typeKind = TypeKind.BYTE; | 53 typeKind = TypeKind.BYTE; |
58 typeKind = TypeKind.LONG; | 61 typeKind = TypeKind.LONG; |
59 } else if (element == float.class) { | 62 } else if (element == float.class) { |
60 typeKind = TypeKind.FLOAT; | 63 typeKind = TypeKind.FLOAT; |
61 } else if (element == double.class) { | 64 } else if (element == double.class) { |
62 typeKind = TypeKind.DOUBLE; | 65 typeKind = TypeKind.DOUBLE; |
63 } else if (element == void.class) { | |
64 typeKind = TypeKind.VOID; | |
65 } else { | 66 } else { |
66 assert false; | 67 assert false; |
67 return null; | 68 return null; |
68 } | 69 } |
69 mirror = processingEnv.getTypeUtils().getPrimitiveType(typeKind); | 70 mirror = processingEnv.getTypeUtils().getPrimitiveType(typeKind); |