Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java @ 18774:674c8a6d5e6c
Truffle-DSL: fixed wrong visibility of DSL nodes generated by the new layout.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 05 Jan 2015 01:31:07 +0100 |
parents | a665483c3881 |
children | f4d78e4a878d |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java Mon Jan 05 01:31:07 2015 +0100 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java Mon Jan 05 01:31:07 2015 +0100 @@ -51,7 +51,6 @@ List<CodeTypeElement> generatedNodes = generateNodes(context, node); if (!generatedNodes.isEmpty() || !enclosedTypes.isEmpty()) { - CodeTypeElement type; if (generatedNodes.isEmpty()) { type = createContainer(node); @@ -78,9 +77,7 @@ private static CodeTypeElement makeInnerClass(CodeTypeElement type) { Set<Modifier> modifiers = type.getModifiers(); - if (!modifiers.contains(Modifier.STATIC)) { - modifiers.add(Modifier.STATIC); - } + modifiers.add(Modifier.STATIC); return type; } @@ -104,8 +101,9 @@ } } } - new NodeFactoryFactory(context, node, second).createFactoryMethods(first, ElementUtils.getVisibility(node.getTemplateType().getModifiers())); - ElementUtils.setVisibility(first.getModifiers(), ElementUtils.getVisibility(node.getTemplateType().getModifiers())); + Modifier templateVisibility = ElementUtils.getVisibility(node.getTemplateType().getModifiers()); + new NodeFactoryFactory(context, node, second).createFactoryMethods(first, templateVisibility); + ElementUtils.setVisibility(first.getModifiers(), templateVisibility); for (ExecutableElement constructor : ElementFilter.constructorsIn(first.getEnclosedElements())) { ElementUtils.setVisibility(((CodeExecutableElement) constructor).getModifiers(), Modifier.PRIVATE); }