Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java @ 16834:21e0ab3c1395
Truffle-DSL: minor fix for import guards.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Thu, 14 Aug 2014 17:10:53 +0200 |
parents | 13cf9b6b325c |
children | 2db61eddcb97 |
comparison
equal
deleted
inserted
replaced
16833:445f6456c4a5 | 16834:21e0ab3c1395 |
---|---|
123 | 123 |
124 parsedNodes.put(typeName, node); | 124 parsedNodes.put(typeName, node); |
125 return node; | 125 return node; |
126 } | 126 } |
127 | 127 |
128 @SuppressWarnings("unchecked") | |
129 private NodeData parseNode(TypeElement originalTemplateType) { | 128 private NodeData parseNode(TypeElement originalTemplateType) { |
130 // reloading the type elements is needed for ecj | 129 // reloading the type elements is needed for ecj |
131 TypeElement templateType = ElementUtils.fromTypeMirror(context.reloadTypeElement(originalTemplateType)); | 130 TypeElement templateType = ElementUtils.fromTypeMirror(context.reloadTypeElement(originalTemplateType)); |
132 | 131 |
133 if (ElementUtils.findAnnotationMirror(processingEnv, originalTemplateType, GeneratedBy.class) != null) { | 132 if (ElementUtils.findAnnotationMirror(processingEnv, originalTemplateType, GeneratedBy.class) != null) { |
137 | 136 |
138 List<TypeElement> lookupTypes = collectSuperClasses(new ArrayList<TypeElement>(), templateType); | 137 List<TypeElement> lookupTypes = collectSuperClasses(new ArrayList<TypeElement>(), templateType); |
139 if (!ElementUtils.isAssignable(templateType.asType(), context.getTruffleTypes().getNode())) { | 138 if (!ElementUtils.isAssignable(templateType.asType(), context.getTruffleTypes().getNode())) { |
140 return null; | 139 return null; |
141 } | 140 } |
142 List<? extends Element> elements = CompilerFactory.getCompiler(templateType).getAllMembersInDeclarationOrder(context.getEnvironment(), templateType); | 141 List<Element> elements = new ArrayList<>(CompilerFactory.getCompiler(templateType).getAllMembersInDeclarationOrder(context.getEnvironment(), templateType)); |
143 | 142 |
144 NodeData node = parseNodeData(templateType, elements, lookupTypes); | 143 NodeData node = parseNodeData(templateType, elements, lookupTypes); |
145 | 144 |
146 parseImportGuards(node, lookupTypes, (List<Element>) elements); | 145 parseImportGuards(node, lookupTypes, elements); |
147 | 146 |
148 if (node.hasErrors()) { | 147 if (node.hasErrors()) { |
149 return node; // error sync point | 148 return node; // error sync point |
150 } | 149 } |
151 | 150 |