newCode.add("\t" + STRUCT_NEW_DECLARE_DEFINE(ANNO_INIT, structName));
newCode.add("\t"
+ ASSIGN_TO_PTR(structName, "init_func",
- "(void*) __SPEC_INIT__"));
+ "(void_func_t) __SPEC_INIT__"));
newCode.add("\t"
+ ASSIGN_TO_PTR(structName, "cleanup_func",
- "(void*) __SPEC_CLEANUP__"));
+ "(cleanup_func_t) __SPEC_CLEANUP__"));
newCode.add("\t"
+ ASSIGN_TO_PTR(structName, "func_table", "func_ptr_table"));
newCode.add("\t"
if (templateList == null) {
newCode.add(DECLARE("void**", varPrefix + "func_ptr_table"));
newCode.add(DECLARE("hb_rule**", varPrefix + "hb_rule_table"));
+ newCode.add(DECLARE("commutativity_rule**", varPrefix + "commutativity_rule_table"));
for (int i = 0; i < construct.code.declareVar.size(); i++) {
VariableDeclaration varDecl = construct.code.declareVar.get(i);
newCode.add(DECLARE(varDecl.type, varPrefix + varDecl.name));
newCode.add(DECLARE("void**", varPrefix + "func_ptr_table"));
newCode.add(templateDecl);
newCode.add(DECLARE("hb_rule**", varPrefix + "hb_rule_table"));
+ newCode.add(DECLARE("commutativity_rule**", varPrefix + "commutativity_rule_table"));
for (int i = 0; i < construct.code.declareVar.size(); i++) {
VariableDeclaration varDecl = construct.code.declareVar.get(i);
newCode.add(templateDecl);
for (int i = 0; i < rules.size(); i++) {
CommutativityRule rule = rules.get(i);
- String interfaceNumBefore = Integer
- .toString(semantics.interface2Num.get(rule.method1));
+ Integer method = semantics.interface2Num.get(rule.method1);
+ if (method == null) {
+ System.out.println("Wrong method label in commutativity rule: " + rule.method1);
+ }
+ String interfaceNumBefore = Integer.toString(method);
String interfaceNumAfter = Integer.toString(semantics.interface2Num
.get(rule.method2));
String conditionFuncName = "CommutativityCondition" + i;