Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/CodeElementFactory.java @ 7502:6343a09b2ec1
Codegen operation generation is inferred from the node type hierarchy.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 18 Jan 2013 13:28:12 +0100 |
parents | a748e4d44694 |
children | 5e3d1a68664e |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/CodeElementFactory.java Thu Jan 17 17:21:16 2013 +0100 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/CodeElementFactory.java Fri Jan 18 13:28:12 2013 +0100 @@ -44,9 +44,12 @@ protected void createChildren(M m) { } @SuppressWarnings("unchecked") - public final CodeElement<?> process(M m) { + public CodeElement<?> process(CodeElement parent, M m) { model = m; element = (CodeElement<? super Element>) create(model); + if (parent != null) { + parent.add(element); + } if (element != null) { createChildren(model); } @@ -58,7 +61,7 @@ } protected <MO, K extends Element> void add(CodeElementFactory<MO> factory, MO m) { - this.element.add(factory.process(m)); + factory.process(this.element, m); } public ProcessorContext getContext() {