comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/Utils.java @ 9210:160f088e40db

Made handling of compile errors more robust in the truffle annotation parser.
author Christian Humer <christian.humer@gmail.com>
date Mon, 08 Apr 2013 16:50:51 +0200
parents 5eeade940236
children bd067a48a9c2
comparison
equal deleted inserted replaced
9209:119a20bb3b1d 9210:160f088e40db
208 b.append("Super").append(getTypeId(type.getExtendsBound())); 208 b.append("Super").append(getTypeId(type.getExtendsBound()));
209 } 209 }
210 return b.toString(); 210 return b.toString();
211 case TYPEVAR: 211 case TYPEVAR:
212 return "Any"; 212 return "Any";
213 case ERROR:
214 throw new CompileErrorException("Type error " + mirror);
213 default: 215 default:
214 throw new RuntimeException("Unknown type specified " + mirror.getKind() + " mirror: " + mirror); 216 throw new RuntimeException("Unknown type specified " + mirror.getKind() + " mirror: " + mirror);
215 } 217 }
216 } 218 }
217 219
245 return "void"; 247 return "void";
246 case WILDCARD: 248 case WILDCARD:
247 return getWildcardName((WildcardType) mirror); 249 return getWildcardName((WildcardType) mirror);
248 case TYPEVAR: 250 case TYPEVAR:
249 return "?"; 251 return "?";
252 case ERROR:
253 throw new CompileErrorException("Type error " + mirror);
250 default: 254 default:
251 throw new RuntimeException("Unknown type specified " + mirror.getKind() + " mirror: " + mirror); 255 throw new RuntimeException("Unknown type specified " + mirror.getKind() + " mirror: " + mirror);
252 } 256 }
253 } 257 }
254 258
311 return getQualifiedName(((ArrayType) mirror).getComponentType()); 315 return getQualifiedName(((ArrayType) mirror).getComponentType());
312 case VOID: 316 case VOID:
313 return "void"; 317 return "void";
314 case TYPEVAR: 318 case TYPEVAR:
315 return getSimpleName(mirror); 319 return getSimpleName(mirror);
320 case ERROR:
321 throw new CompileErrorException("Type error " + mirror);
316 default: 322 default:
317 throw new RuntimeException("Unknown type specified " + mirror + " mirror: " + mirror); 323 throw new RuntimeException("Unknown type specified " + mirror + " mirror: " + mirror);
318 } 324 }
319 } 325 }
320 326