Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/ShortCircuitParser.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 | a80bf36c6a1e |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/ShortCircuitParser.java Wed Mar 13 11:32:43 2013 +0100 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/ShortCircuitParser.java Wed Mar 13 19:58:28 2013 +0100 @@ -49,12 +49,6 @@ @Override public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) { String shortCircuitValue = Utils.getAnnotationValue(String.class, mirror, "value"); - - if (!shortCircuitValues.contains(shortCircuitValue)) { - getContext().getLog().error(method, mirror, "Invalid short circuit value %s.", shortCircuitValue); - return null; - } - return createDefaultMethodSpec(method, mirror, shortCircuitValue); } @@ -66,8 +60,11 @@ @Override public ShortCircuitData create(TemplateMethod method) { String shortCircuitValue = Utils.getAnnotationValue(String.class, method.getMarkerAnnotation(), "value"); - assert shortCircuitValue != null; - assert shortCircuitValues.contains(shortCircuitValue); + + if (!shortCircuitValues.contains(shortCircuitValue)) { + method.addError("Invalid short circuit value %s.", shortCircuitValue); + } + return new ShortCircuitData(method, shortCircuitValue); }