changeset 16847:043575a99815

moved NodeInfo processor into a separate project to avoid injecting Truffle DSL annotation processor into Graal projects
author Doug Simon <doug.simon@oracle.com>
date Fri, 15 Aug 2014 16:31:49 +0200
parents e3dd75b3c290
children 518559db79c6
files graal/com.oracle.graal.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor graal/com.oracle.graal.nodeinfo.processor/src/com/oracle/graal/nodeinfo/processor/GraphNodeGenerator.java graal/com.oracle.graal.nodeinfo.processor/src/com/oracle/graal/nodeinfo/processor/GraphNodeProcessor.java graal/com.oracle.graal.nodeinfo/src/META-INF/services/javax.annotation.processing.Processor graal/com.oracle.graal.nodeinfo/src/com/oracle/graal/nodeinfo/processor/GraphNodeGenerator.java graal/com.oracle.graal.nodeinfo/src/com/oracle/graal/nodeinfo/processor/GraphNodeProcessor.java mx/projects mxtool/mx.py
diffstat 8 files changed, 295 insertions(+), 284 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor	Fri Aug 15 16:31:49 2014 +0200
@@ -0,0 +1,1 @@
+com.oracle.graal.nodeinfo.processor.GraphNodeProcessor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodeinfo.processor/src/com/oracle/graal/nodeinfo/processor/GraphNodeGenerator.java	Fri Aug 15 16:31:49 2014 +0200
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodeinfo.processor;
+
+import static com.oracle.truffle.dsl.processor.java.ElementUtils.*;
+
+import javax.annotation.processing.*;
+import javax.lang.model.element.*;
+import javax.lang.model.type.*;
+import javax.lang.model.util.*;
+
+import com.oracle.graal.nodeinfo.*;
+import com.oracle.truffle.dsl.processor.java.*;
+import com.oracle.truffle.dsl.processor.java.model.*;
+
+/**
+ * Generates the source code for a Node class.
+ */
+public class GraphNodeGenerator {
+
+    private final GraphNodeProcessor processor;
+
+    public GraphNodeGenerator(GraphNodeProcessor processor) {
+        this.processor = processor;
+    }
+
+    public ProcessingEnvironment getProcessingEnv() {
+        return processor.getProcessingEnv();
+    }
+
+    private String getGeneratedClassName(TypeElement node) {
+
+        TypeElement typeElement = node;
+
+        String newClassName = typeElement.getSimpleName().toString() + "Gen";
+        Element enclosing = typeElement.getEnclosingElement();
+        while (enclosing != null) {
+            if (enclosing.getKind() == ElementKind.CLASS || enclosing.getKind() == ElementKind.INTERFACE) {
+                if (enclosing.getModifiers().contains(Modifier.PRIVATE)) {
+                    processor.errorMessage(enclosing, "%s %s cannot be private", enclosing.getKind().name().toLowerCase(), enclosing);
+                    return null;
+                }
+                newClassName = enclosing.getSimpleName() + "$" + newClassName;
+            } else {
+                assert enclosing.getKind() == ElementKind.PACKAGE;
+            }
+            enclosing = enclosing.getEnclosingElement();
+        }
+        return newClassName;
+    }
+
+    public CodeCompilationUnit process(TypeElement node) {
+        CodeCompilationUnit compilationUnit = new CodeCompilationUnit();
+
+        PackageElement packageElement = ElementUtils.findPackageElement(node);
+
+        String newClassName = getGeneratedClassName(node);
+
+        CodeTypeElement nodeGenElement = new CodeTypeElement(modifiers(), ElementKind.CLASS, packageElement, newClassName);
+
+        if (node.getModifiers().contains(Modifier.ABSTRACT)) {
+            // we do not support implementation of abstract methods yet.
+            nodeGenElement.getModifiers().add(Modifier.ABSTRACT);
+        }
+
+        nodeGenElement.setSuperClass(node.asType());
+
+        for (ExecutableElement constructor : ElementFilter.constructorsIn(node.getEnclosedElements())) {
+            if (constructor.getModifiers().contains(Modifier.PRIVATE)) {
+                // ignore private constructors
+                continue;
+            }
+            nodeGenElement.add(createSuperConstructor(nodeGenElement, constructor));
+        }
+
+        DeclaredType generatedNode = (DeclaredType) ElementUtils.getType(getProcessingEnv(), GeneratedNode.class);
+        CodeAnnotationMirror generatedByMirror = new CodeAnnotationMirror(generatedNode);
+        generatedByMirror.setElementValue(generatedByMirror.findExecutableElement("value"), new CodeAnnotationValue(node.asType()));
+        nodeGenElement.getAnnotationMirrors().add(generatedByMirror);
+
+        nodeGenElement.add(createDummyExampleMethod());
+
+        compilationUnit.add(nodeGenElement);
+        return compilationUnit;
+    }
+
+    private CodeExecutableElement createSuperConstructor(TypeElement type, ExecutableElement element) {
+        CodeExecutableElement executable = CodeExecutableElement.clone(getProcessingEnv(), element);
+
+        // to create a constructor we have to set the return type to null.(TODO needs fix)
+        executable.setReturnType(null);
+        // we have to set the name manually otherwise <init> is inferred (TODO needs fix)
+        executable.setSimpleName(CodeNames.of(type.getSimpleName().toString()));
+
+        CodeTreeBuilder b = executable.createBuilder();
+        b.startStatement().startSuperCall();
+        for (VariableElement v : element.getParameters()) {
+            b.string(v.getSimpleName().toString());
+        }
+        b.end().end();
+
+        return executable;
+    }
+
+    public ExecutableElement createDummyExampleMethod() {
+        CodeExecutableElement method = new CodeExecutableElement(modifiers(Modifier.PROTECTED), ElementUtils.getType(getProcessingEnv(), int.class), "computeTheMeaningOfLife");
+
+        CodeTreeBuilder builder = method.createBuilder();
+        builder.string("// this method got partially evaluated").newLine();
+        builder.startReturn().string("42").end();
+
+        return method;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodeinfo.processor/src/com/oracle/graal/nodeinfo/processor/GraphNodeProcessor.java	Fri Aug 15 16:31:49 2014 +0200
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodeinfo.processor;
+
+import java.io.*;
+import java.util.*;
+
+import javax.annotation.processing.*;
+import javax.lang.model.*;
+import javax.lang.model.element.*;
+import javax.lang.model.type.*;
+import javax.lang.model.util.*;
+import javax.tools.Diagnostic.Kind;
+
+import com.oracle.graal.nodeinfo.*;
+import com.oracle.truffle.dsl.processor.*;
+import com.oracle.truffle.dsl.processor.java.*;
+import com.oracle.truffle.dsl.processor.java.model.*;
+import com.oracle.truffle.dsl.processor.java.transform.*;
+
+@SupportedSourceVersion(SourceVersion.RELEASE_8)
+@SupportedAnnotationTypes({"com.oracle.graal.nodeinfo.NodeInfo"})
+public class GraphNodeProcessor extends AbstractProcessor {
+    @Override
+    public SourceVersion getSupportedSourceVersion() {
+        return SourceVersion.latest();
+    }
+
+    void errorMessage(Element element, String format, Object... args) {
+        processingEnv.getMessager().printMessage(Kind.ERROR, String.format(format, args), element);
+    }
+
+    /**
+     * Bugs in an annotation processor can cause silent failure so try to report any exception
+     * throws as errors.
+     */
+    private void reportException(Element element, Throwable t) {
+        StringWriter buf = new StringWriter();
+        t.printStackTrace(new PrintWriter(buf));
+        buf.toString();
+        errorMessage(element, "Exception thrown during processing: %s", buf.toString());
+    }
+
+    ProcessingEnvironment getProcessingEnv() {
+        return processingEnv;
+    }
+
+    boolean isNodeType(Element element) {
+        if (element.getKind() != ElementKind.CLASS) {
+            return false;
+        }
+        TypeElement type = (TypeElement) element;
+        Types types = processingEnv.getTypeUtils();
+
+        while (type != null) {
+            if (type.toString().equals("com.oracle.graal.graph.Node")) {
+                return true;
+            }
+            type = (TypeElement) types.asElement(type.getSuperclass());
+        }
+        return false;
+    }
+
+    @Override
+    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+        if (roundEnv.processingOver()) {
+            return false;
+        }
+
+        GraphNodeGenerator gen = new GraphNodeGenerator(this);
+
+        for (Element element : roundEnv.getElementsAnnotatedWith(NodeInfo.class)) {
+            try {
+                if (!isNodeType(element)) {
+                    errorMessage(element, "%s can only be applied to Node subclasses", NodeInfo.class.getSimpleName());
+                    continue;
+                }
+
+                NodeInfo nodeInfo = element.getAnnotation(NodeInfo.class);
+                if (nodeInfo == null) {
+                    errorMessage(element, "Cannot get %s annotation from annotated element", NodeInfo.class.getSimpleName());
+                    continue;
+                }
+
+                TypeElement typeElement = (TypeElement) element;
+
+                if (typeElement.getModifiers().contains(Modifier.FINAL)) {
+                    errorMessage(element, "%s annotated class cannot be final", NodeInfo.class.getSimpleName());
+                    continue;
+                }
+
+                CodeCompilationUnit unit = gen.process(typeElement);
+                unit.setGeneratorElement(typeElement);
+
+                DeclaredType overrideType = (DeclaredType) ElementUtils.getType(processingEnv, Override.class);
+                DeclaredType unusedType = (DeclaredType) ElementUtils.getType(processingEnv, SuppressWarnings.class);
+                unit.accept(new GenerateOverrideVisitor(overrideType), null);
+                unit.accept(new FixWarningsVisitor(processingEnv, unusedType, overrideType), null);
+                unit.accept(new CodeWriter(processingEnv, typeElement), null);
+            } catch (Throwable t) {
+                if (!isBug367599(t)) {
+                    reportException(element, t);
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Determines if a given exception is (most likely) caused by <a
+     * href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=367599">Bug 367599</a>.
+     */
+    public static boolean isBug367599(Throwable t) {
+        for (StackTraceElement ste : t.getStackTrace()) {
+            if (ste.toString().contains("org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeFilerImpl.create")) {
+                // See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=367599
+                return true;
+            }
+        }
+        if (t.getCause() != null) {
+            return isBug367599(t.getCause());
+        }
+        return false;
+    }
+}
--- a/graal/com.oracle.graal.nodeinfo/src/META-INF/services/javax.annotation.processing.Processor	Fri Aug 15 13:54:37 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.oracle.graal.nodeinfo.processor.GraphNodeProcessor
\ No newline at end of file
--- a/graal/com.oracle.graal.nodeinfo/src/com/oracle/graal/nodeinfo/processor/GraphNodeGenerator.java	Fri Aug 15 13:54:37 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodeinfo.processor;
-
-import static com.oracle.truffle.dsl.processor.java.ElementUtils.*;
-
-import javax.annotation.processing.*;
-import javax.lang.model.element.*;
-import javax.lang.model.type.*;
-import javax.lang.model.util.*;
-
-import com.oracle.graal.nodeinfo.*;
-import com.oracle.truffle.dsl.processor.java.*;
-import com.oracle.truffle.dsl.processor.java.model.*;
-
-/**
- * Generates the source code for a Node class.
- */
-public class GraphNodeGenerator {
-
-    private final GraphNodeProcessor processor;
-
-    public GraphNodeGenerator(GraphNodeProcessor processor) {
-        this.processor = processor;
-    }
-
-    public ProcessingEnvironment getProcessingEnv() {
-        return processor.getProcessingEnv();
-    }
-
-    private String getGeneratedClassName(TypeElement node) {
-
-        TypeElement typeElement = node;
-
-        String newClassName = typeElement.getSimpleName().toString() + "Gen";
-        Element enclosing = typeElement.getEnclosingElement();
-        while (enclosing != null) {
-            if (enclosing.getKind() == ElementKind.CLASS || enclosing.getKind() == ElementKind.INTERFACE) {
-                if (enclosing.getModifiers().contains(Modifier.PRIVATE)) {
-                    processor.errorMessage(enclosing, "%s %s cannot be private", enclosing.getKind().name().toLowerCase(), enclosing);
-                    return null;
-                }
-                newClassName = enclosing.getSimpleName() + "$" + newClassName;
-            } else {
-                assert enclosing.getKind() == ElementKind.PACKAGE;
-            }
-            enclosing = enclosing.getEnclosingElement();
-        }
-        return newClassName;
-    }
-
-    public CodeCompilationUnit process(TypeElement node) {
-        CodeCompilationUnit compilationUnit = new CodeCompilationUnit();
-
-        PackageElement packageElement = ElementUtils.findPackageElement(node);
-
-        String newClassName = getGeneratedClassName(node);
-
-        CodeTypeElement nodeGenElement = new CodeTypeElement(modifiers(), ElementKind.CLASS, packageElement, newClassName);
-
-        if (node.getModifiers().contains(Modifier.ABSTRACT)) {
-            // we do not support implementation of abstract methods yet.
-            nodeGenElement.getModifiers().add(Modifier.ABSTRACT);
-        }
-
-        nodeGenElement.setSuperClass(node.asType());
-
-        for (ExecutableElement constructor : ElementFilter.constructorsIn(node.getEnclosedElements())) {
-            if (constructor.getModifiers().contains(Modifier.PRIVATE)) {
-                // ignore private constructors
-                continue;
-            }
-            nodeGenElement.add(createSuperConstructor(nodeGenElement, constructor));
-        }
-
-        DeclaredType generatedNode = (DeclaredType) ElementUtils.getType(getProcessingEnv(), GeneratedNode.class);
-        CodeAnnotationMirror generatedByMirror = new CodeAnnotationMirror(generatedNode);
-        generatedByMirror.setElementValue(generatedByMirror.findExecutableElement("value"), new CodeAnnotationValue(node.asType()));
-        nodeGenElement.getAnnotationMirrors().add(generatedByMirror);
-
-        nodeGenElement.add(createDummyExampleMethod());
-
-        compilationUnit.add(nodeGenElement);
-        return compilationUnit;
-    }
-
-    private CodeExecutableElement createSuperConstructor(TypeElement type, ExecutableElement element) {
-        CodeExecutableElement executable = CodeExecutableElement.clone(getProcessingEnv(), element);
-
-        // to create a constructor we have to set the return type to null.(TODO needs fix)
-        executable.setReturnType(null);
-        // we have to set the name manually otherwise <init> is inferred (TODO needs fix)
-        executable.setSimpleName(CodeNames.of(type.getSimpleName().toString()));
-
-        CodeTreeBuilder b = executable.createBuilder();
-        b.startStatement().startSuperCall();
-        for (VariableElement v : element.getParameters()) {
-            b.string(v.getSimpleName().toString());
-        }
-        b.end().end();
-
-        return executable;
-    }
-
-    public ExecutableElement createDummyExampleMethod() {
-        CodeExecutableElement method = new CodeExecutableElement(modifiers(Modifier.PROTECTED), ElementUtils.getType(getProcessingEnv(), int.class), "computeTheMeaningOfLife");
-
-        CodeTreeBuilder builder = method.createBuilder();
-        builder.string("// this method got partially evaluated").newLine();
-        builder.startReturn().string("42").end();
-
-        return method;
-    }
-
-}
--- a/graal/com.oracle.graal.nodeinfo/src/com/oracle/graal/nodeinfo/processor/GraphNodeProcessor.java	Fri Aug 15 13:54:37 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.nodeinfo.processor;
-
-import java.io.*;
-import java.util.*;
-
-import javax.annotation.processing.*;
-import javax.lang.model.*;
-import javax.lang.model.element.*;
-import javax.lang.model.type.*;
-import javax.lang.model.util.*;
-import javax.tools.Diagnostic.Kind;
-
-import com.oracle.graal.nodeinfo.*;
-import com.oracle.truffle.dsl.processor.*;
-import com.oracle.truffle.dsl.processor.java.*;
-import com.oracle.truffle.dsl.processor.java.model.*;
-import com.oracle.truffle.dsl.processor.java.transform.*;
-
-@SupportedSourceVersion(SourceVersion.RELEASE_8)
-@SupportedAnnotationTypes({"com.oracle.graal.nodeinfo.NodeInfo"})
-public class GraphNodeProcessor extends AbstractProcessor {
-    @Override
-    public SourceVersion getSupportedSourceVersion() {
-        return SourceVersion.latest();
-    }
-
-    void errorMessage(Element element, String format, Object... args) {
-        processingEnv.getMessager().printMessage(Kind.ERROR, String.format(format, args), element);
-    }
-
-    /**
-     * Bugs in an annotation processor can cause silent failure so try to report any exception
-     * throws as errors.
-     */
-    private void reportException(Element element, Throwable t) {
-        StringWriter buf = new StringWriter();
-        t.printStackTrace(new PrintWriter(buf));
-        buf.toString();
-        errorMessage(element, "Exception thrown during processing: %s", buf.toString());
-    }
-
-    ProcessingEnvironment getProcessingEnv() {
-        return processingEnv;
-    }
-
-    boolean isNodeType(Element element) {
-        if (element.getKind() != ElementKind.CLASS) {
-            return false;
-        }
-        TypeElement type = (TypeElement) element;
-        Types types = processingEnv.getTypeUtils();
-
-        while (type != null) {
-            if (type.toString().equals("com.oracle.graal.graph.Node")) {
-                return true;
-            }
-            type = (TypeElement) types.asElement(type.getSuperclass());
-        }
-        return false;
-    }
-
-    @Override
-    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-        if (roundEnv.processingOver()) {
-            return false;
-        }
-
-        GraphNodeGenerator gen = new GraphNodeGenerator(this);
-
-        for (Element element : roundEnv.getElementsAnnotatedWith(NodeInfo.class)) {
-            try {
-                if (!isNodeType(element)) {
-                    errorMessage(element, "%s can only be applied to Node subclasses", NodeInfo.class.getSimpleName());
-                    continue;
-                }
-
-                NodeInfo nodeInfo = element.getAnnotation(NodeInfo.class);
-                if (nodeInfo == null) {
-                    errorMessage(element, "Cannot get %s annotation from annotated element", NodeInfo.class.getSimpleName());
-                    continue;
-                }
-
-                TypeElement typeElement = (TypeElement) element;
-
-                if (typeElement.getModifiers().contains(Modifier.FINAL)) {
-                    errorMessage(element, "%s annotated class cannot be final", NodeInfo.class.getSimpleName());
-                    continue;
-                }
-
-                CodeCompilationUnit unit = gen.process(typeElement);
-                unit.setGeneratorElement(typeElement);
-
-                DeclaredType overrideType = (DeclaredType) ElementUtils.getType(processingEnv, Override.class);
-                DeclaredType unusedType = (DeclaredType) ElementUtils.getType(processingEnv, SuppressWarnings.class);
-                unit.accept(new GenerateOverrideVisitor(overrideType), null);
-                unit.accept(new FixWarningsVisitor(processingEnv, unusedType, overrideType), null);
-                unit.accept(new CodeWriter(processingEnv, typeElement), null);
-            } catch (Throwable t) {
-                if (!isBug367599(t)) {
-                    reportException(element, t);
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Determines if a given exception is (most likely) caused by <a
-     * href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=367599">Bug 367599</a>.
-     */
-    public static boolean isBug367599(Throwable t) {
-        for (StackTraceElement ste : t.getStackTrace()) {
-            if (ste.toString().contains("org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeFilerImpl.create")) {
-                // See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=367599
-                return true;
-            }
-        }
-        if (t.getCause() != null) {
-            return isBug367599(t.getCause());
-        }
-        return false;
-    }
-}
--- a/mx/projects	Fri Aug 15 13:54:37 2014 +0200
+++ b/mx/projects	Fri Aug 15 16:31:49 2014 +0200
@@ -344,15 +344,22 @@
 # graal.nodeinfo
 project@com.oracle.graal.nodeinfo@subDir=graal
 project@com.oracle.graal.nodeinfo@sourceDirs=src
-project@com.oracle.graal.nodeinfo@dependencies=com.oracle.truffle.dsl.processor
 project@com.oracle.graal.nodeinfo@javaCompliance=1.8
 project@com.oracle.graal.nodeinfo@workingSets=Graal,Graph
 
+# graal.nodeinfo.processor
+project@com.oracle.graal.nodeinfo.processor@subDir=graal
+project@com.oracle.graal.nodeinfo.processor@sourceDirs=src
+project@com.oracle.graal.nodeinfo.processor@dependencies=com.oracle.graal.nodeinfo,com.oracle.truffle.dsl.processor
+project@com.oracle.graal.nodeinfo.processor@javaCompliance=1.8
+project@com.oracle.graal.nodeinfo.processor@workingSets=Graal,Graph
+
 # graal.graph
 project@com.oracle.graal.graph@subDir=graal
 project@com.oracle.graal.graph@sourceDirs=src
 project@com.oracle.graal.graph@dependencies=com.oracle.graal.nodeinfo,com.oracle.graal.debug,com.oracle.graal.compiler.common,com.oracle.graal.api.collections,com.oracle.graal.api.runtime,FINDBUGS
 project@com.oracle.graal.graph@javaCompliance=1.8
+project@com.oracle.graal.graph@annotationProcessors=com.oracle.graal.nodeinfo.processor
 project@com.oracle.graal.graph@workingSets=Graal,Graph
 
 # graal.graph.test
@@ -826,7 +833,7 @@
 # graal.truffle
 project@com.oracle.graal.truffle@subDir=graal
 project@com.oracle.graal.truffle@sourceDirs=src
-project@com.oracle.graal.truffle@dependencies=com.oracle.graal.replacements,com.oracle.graal.printer,com.oracle.graal.runtime
+project@com.oracle.graal.truffle@dependencies=com.oracle.truffle.api,com.oracle.graal.replacements,com.oracle.graal.runtime,com.oracle.graal.printer
 project@com.oracle.graal.truffle@checkstyle=com.oracle.graal.graph
 project@com.oracle.graal.truffle@javaCompliance=1.8
 project@com.oracle.graal.truffle@workingSets=Graal,Truffle
--- a/mxtool/mx.py	Fri Aug 15 13:54:37 2014 +0200
+++ b/mxtool/mx.py	Fri Aug 15 16:31:49 2014 +0200
@@ -469,7 +469,11 @@
                 aps = set(self._declaredAnnotationProcessors)
                 for ap in aps:
                     if project(ap).definedAnnotationProcessorsDist is None:
-                        abort('Project ' + ap + ' declared in annotationProcessors property of ' + self.name + ' does not define any annotation processors')
+                        config = join(project(ap).source_dirs()[0], 'META-INF', 'services', 'javax.annotation.processing.Processor')
+                        if not exists(config):
+                            TimeStampFile(config).touch()
+                        abort('Project ' + ap + ' declared in annotationProcessors property of ' + self.name + ' does not define any annotation processors.\n' +
+                              'Please specify the annotation processors in ' + config)
 
             allDeps = self.all_deps([], includeLibs=False, includeSelf=False, includeAnnotationProcessors=False)
             for p in allDeps: