Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/AbstractParser.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 | 5e3d1a68664e |
children | 160f088e40db |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/AbstractParser.java Wed Mar 13 11:32:43 2013 +0100 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/AbstractParser.java Wed Mar 13 19:58:28 2013 +0100 @@ -58,12 +58,22 @@ if (!context.getTruffleTypes().verify(context, element, mirror)) { return null; } - return parse(element, mirror); + M model = parse(element, mirror); + if (model == null) { + return null; + } + + model.emitMessages((TypeElement) element, log); + return filterErrorElements(model); } finally { this.roundEnv = null; } } + protected M filterErrorElements(M model) { + return model.hasErrors() ? null : model; + } + protected abstract M parse(Element element, AnnotationMirror mirror); public abstract Class<? extends Annotation> getAnnotationType();