Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeFieldData.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 | cb70ed101b5f |
children | 89006c76f737 |
comparison
equal
deleted
inserted
replaced
8251:cb70ed101b5f | 8252:0905d796944a |
---|---|
23 package com.oracle.truffle.codegen.processor.node; | 23 package com.oracle.truffle.codegen.processor.node; |
24 | 24 |
25 import javax.lang.model.element.*; | 25 import javax.lang.model.element.*; |
26 import javax.lang.model.type.*; | 26 import javax.lang.model.type.*; |
27 | 27 |
28 public class NodeFieldData { | 28 import com.oracle.truffle.codegen.processor.template.*; |
29 | |
30 public class NodeFieldData extends MessageContainer { | |
29 | 31 |
30 public enum FieldKind { | 32 public enum FieldKind { |
31 CHILD, CHILDREN | 33 CHILD, CHILDREN |
32 } | 34 } |
33 | 35 |
41 | 43 |
42 private final FieldKind fieldKind; | 44 private final FieldKind fieldKind; |
43 private final ExecutionKind executionKind; | 45 private final ExecutionKind executionKind; |
44 private NodeData nodeData; | 46 private NodeData nodeData; |
45 | 47 |
46 public NodeFieldData(NodeData typeNodeData, VariableElement fieldElement, Element accessElement, AnnotationMirror childAnnotationMirror, FieldKind fieldKind, ExecutionKind executionKind) { | 48 public NodeFieldData(VariableElement fieldElement, Element accessElement, AnnotationMirror childAnnotationMirror, FieldKind fieldKind, ExecutionKind executionKind) { |
47 this.fieldElement = fieldElement; | 49 this.fieldElement = fieldElement; |
48 this.accessElement = accessElement; | 50 this.accessElement = accessElement; |
49 this.childAnnotationMirror = childAnnotationMirror; | 51 this.childAnnotationMirror = childAnnotationMirror; |
50 this.nodeData = typeNodeData; | |
51 this.fieldKind = fieldKind; | 52 this.fieldKind = fieldKind; |
52 this.executionKind = executionKind; | 53 this.executionKind = executionKind; |
53 } | 54 } |
54 | 55 |
55 NodeFieldData(NodeFieldData field) { | 56 NodeFieldData(NodeFieldData field) { |
59 this.fieldKind = field.fieldKind; | 60 this.fieldKind = field.fieldKind; |
60 this.executionKind = field.executionKind; | 61 this.executionKind = field.executionKind; |
61 this.nodeData = field.nodeData; | 62 this.nodeData = field.nodeData; |
62 } | 63 } |
63 | 64 |
65 @Override | |
66 public Element getMessageElement() { | |
67 return fieldElement; | |
68 } | |
69 | |
64 public boolean isShortCircuit() { | 70 public boolean isShortCircuit() { |
65 return executionKind == ExecutionKind.SHORT_CIRCUIT; | 71 return executionKind == ExecutionKind.SHORT_CIRCUIT; |
66 } | 72 } |
67 | 73 |
68 void setNode(NodeData nodeData) { | 74 void setNode(NodeData nodeData) { |
69 this.nodeData = nodeData; | 75 this.nodeData = nodeData; |
76 getMessages().addAll(nodeData.collectMessages()); | |
70 } | 77 } |
71 | 78 |
72 public VariableElement getFieldElement() { | 79 public VariableElement getFieldElement() { |
73 return fieldElement; | 80 return fieldElement; |
74 } | 81 } |