diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/ast/CodeElement.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/ast/CodeElement.java	Thu Jan 17 17:21:16 2013 +0100
+++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/ast/CodeElement.java	Fri Jan 18 13:28:12 2013 +0100
@@ -119,9 +119,6 @@
     }
 
     void setEnclosingElement(Element parent) {
-        if (this.enclosingElement != null && parent != null) {
-            throw new IllegalStateException("Element already added to " + parent);
-        }
         this.enclosingElement = parent;
     }
 
@@ -161,7 +158,7 @@
             return writer;
         }
         public String getString() {
-            return new String(((CharArrayWriter) writer).toCharArray());
+            return new String(((CharArrayWriter) writer).toCharArray()).trim();
         }
 
     }