Mercurial > hg > truffle
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java @ 19282:ae81dd154fb6
Truffle-DSL: remove old DSL layout; Make new layout the default.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Thu, 22 Jan 2015 20:44:24 +0100 |
parents | c0fb70634640 |
children | 18c0f02fa4d2 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java Thu Jan 22 20:42:48 2015 +0100 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java Thu Jan 22 20:44:24 2015 +0100 @@ -118,14 +118,6 @@ return builder.build(); } - public static CodeTree cast(TypeData sourceType, TypeData targetType, CodeTree content) { - if (sourceType != null && !sourceType.needsCastTo(targetType)) { - return content; - } else { - return cast(targetType, content); - } - } - public static CodeTree expect(TypeData type, CodeTree content) { if (type.isGeneric() || type.isVoid()) { return content; @@ -208,15 +200,13 @@ public CodeTypeElement create(ProcessorContext context, TypeSystemData typeSystem) { CodeTypeElement clazz = new TypeClassFactory(context, typeSystem).create(); - if (typeSystem.getOptions().useNewLayout()) { - clazz.add(new TypeSystemNodeFactory(context, typeSystem).create()); + clazz.add(new TypeSystemNodeFactory(context, typeSystem).create()); - if (typeSystem.getOptions().implicitCastOptimization().isMergeCasts()) { - for (TypeData type : typeSystem.getTypes()) { - List<TypeData> sourceTypes = typeSystem.lookupSourceTypes(type); - if (sourceTypes.size() > 1) { - clazz.add(new ImplicitCastNodeFactory(context, type).create()); - } + if (typeSystem.getOptions().implicitCastOptimization().isMergeCasts()) { + for (TypeData type : typeSystem.getTypes()) { + List<TypeData> sourceTypes = typeSystem.lookupSourceTypes(type); + if (sourceTypes.size() > 1) { + clazz.add(new ImplicitCastNodeFactory(context, type).create()); } } }