Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/typesystem/TypeData.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 | c4c3f50fa9c2 |
children | 61ba6fc21ba4 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/typesystem/TypeData.java Wed Mar 13 11:32:43 2013 +0100 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/typesystem/TypeData.java Wed Mar 13 19:58:28 2013 +0100 @@ -30,21 +30,38 @@ import com.oracle.truffle.codegen.processor.*; import com.oracle.truffle.codegen.processor.template.*; -public class TypeData extends Template { +public class TypeData extends MessageContainer { - protected TypeSystemData typeSystem; + private final TypeSystemData typeSystem; + private final AnnotationValue annotationValue; private final TypeMirror primitiveType; private final TypeMirror boxedType; private final List<TypeCastData> typeCasts = new ArrayList<>(); private final List<TypeCheckData> typeChecks = new ArrayList<>(); - public TypeData(TypeElement templateType, AnnotationMirror annotation, TypeMirror primitiveType, TypeMirror boxedType) { - super(templateType, null, annotation); + public TypeData(TypeSystemData typeSystem, AnnotationValue value, TypeMirror primitiveType, TypeMirror boxedType) { + this.typeSystem = typeSystem; + this.annotationValue = value; this.primitiveType = primitiveType; this.boxedType = boxedType; } + @Override + public Element getMessageElement() { + return typeSystem.getMessageElement(); + } + + @Override + public AnnotationMirror getMessageAnnotation() { + return typeSystem.getMessageAnnotation(); + } + + @Override + public AnnotationValue getMessageAnnotationValue() { + return annotationValue; + } + void addTypeCast(TypeCastData typeCast) { this.typeCasts.add(typeCast); }