comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/ParameterSpec.java @ 18776:c0fb70634640

Truffle-DSL: support for frame types Frame, MaterializedFrame. Added validation for frame type consistency. Some refactorings along the way.
author Christian Humer <christian.humer@gmail.com>
date Mon, 05 Jan 2015 01:31:08 +0100
parents 2db61eddcb97
children 62c43fcf5be2
comparison
equal deleted inserted replaced
18775:a069a87b9a02 18776:c0fb70634640
44 private TypeDef typeDefinition; 44 private TypeDef typeDefinition;
45 45
46 public ParameterSpec(String name, List<TypeMirror> allowedTypes, Set<String> typeIdentifiers) { 46 public ParameterSpec(String name, List<TypeMirror> allowedTypes, Set<String> typeIdentifiers) {
47 this.name = name; 47 this.name = name;
48 this.allowedTypes = allowedTypes; 48 this.allowedTypes = allowedTypes;
49 this.allowedTypesIdentifier = typeIdentifiers;
50 }
51
52 public ParameterSpec(String name, List<TypeMirror> allowedTypes) {
53 this.name = name;
54 this.allowedTypes = allowedTypes;
55 Set<String> typeIdentifiers = new HashSet<>();
56 for (TypeMirror type : allowedTypes) {
57 typeIdentifiers.add(ElementUtils.getUniqueIdentifier(type));
58 }
49 this.allowedTypesIdentifier = typeIdentifiers; 59 this.allowedTypesIdentifier = typeIdentifiers;
50 } 60 }
51 61
52 public ParameterSpec(String name, TypeMirror type) { 62 public ParameterSpec(String name, TypeMirror type) {
53 this(name, Arrays.asList(type), new HashSet<>(Arrays.asList(ElementUtils.getUniqueIdentifier(type)))); 63 this(name, Arrays.asList(type), new HashSet<>(Arrays.asList(ElementUtils.getUniqueIdentifier(type))));