Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/ProcessorContext.java @ 9227:6d92fdf1c999
Fixes several minor issues.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 22 Apr 2013 12:52:00 +0200 |
parents | 5e3d1a68664e |
children |
comparison
equal
deleted
inserted
replaced
9226:e27f125147d6 | 9227:6d92fdf1c999 |
---|---|
27 import java.util.*; | 27 import java.util.*; |
28 | 28 |
29 import javax.annotation.processing.*; | 29 import javax.annotation.processing.*; |
30 import javax.lang.model.element.*; | 30 import javax.lang.model.element.*; |
31 import javax.lang.model.type.*; | 31 import javax.lang.model.type.*; |
32 | 32 import javax.lang.model.util.*; |
33 | |
34 import com.oracle.truffle.codegen.processor.ast.*; | |
33 import com.oracle.truffle.codegen.processor.ast.CodeTypeMirror.ArrayCodeTypeMirror; | 35 import com.oracle.truffle.codegen.processor.ast.CodeTypeMirror.ArrayCodeTypeMirror; |
34 import com.oracle.truffle.codegen.processor.template.*; | 36 import com.oracle.truffle.codegen.processor.template.*; |
35 | 37 |
36 /** | 38 /** |
37 * THIS IS NOT PUBLIC API. | 39 * THIS IS NOT PUBLIC API. |
183 | 185 |
184 void callback(TypeElement template); | 186 void callback(TypeElement template); |
185 | 187 |
186 } | 188 } |
187 | 189 |
190 public TypeMirror reloadTypeElement(TypeElement type) { | |
191 return getType(type.getQualifiedName().toString()); | |
192 } | |
193 | |
194 public TypeMirror reloadType(TypeMirror type) { | |
195 if (type instanceof CodeTypeMirror) { | |
196 return type; | |
197 } else if (type.getKind().isPrimitive()) { | |
198 return type; | |
199 } | |
200 Types types = getEnvironment().getTypeUtils(); | |
201 | |
202 switch (type.getKind()) { | |
203 case ARRAY: | |
204 return types.getArrayType(reloadType(((ArrayType) type).getComponentType())); | |
205 case WILDCARD: | |
206 return types.getWildcardType(((WildcardType) type).getExtendsBound(), ((WildcardType) type).getSuperBound()); | |
207 case DECLARED: | |
208 return reloadTypeElement((TypeElement) (((DeclaredType) type).asElement())); | |
209 } | |
210 return type; | |
211 } | |
188 } | 212 } |