comparison wip_debug.patch @ 128:0fdaa93ed62b

Start to clean up new compiler patch
author Louis Opter <louis@lse.epita.fr>
date Mon, 26 Aug 2013 22:53:34 -0700
parents 72b5b4a62cc5
children
comparison
equal deleted inserted replaced
127:72b5b4a62cc5 128:0fdaa93ed62b
1 # HG changeset patch 1 # HG changeset patch
2 # Parent ea807d6831821c5fb094e7ae9258f5a282ec15e6 2 # Parent ea807d6831821c5fb094e7ae9258f5a282ec15e6
3
3 diff --git a/rathaxes/compiler/passes/common/rtxResolve.inc.cws b/rathaxes/compiler/passes/common/rtxResolve.inc.cws 4 diff --git a/rathaxes/compiler/passes/common/rtxResolve.inc.cws b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
4 --- a/rathaxes/compiler/passes/common/rtxResolve.inc.cws 5 --- a/rathaxes/compiler/passes/common/rtxResolve.inc.cws
5 +++ b/rathaxes/compiler/passes/common/rtxResolve.inc.cws 6 +++ b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
6 @@ -782,6 +782,11 @@ 7 @@ -729,9 +729,17 @@
7 return false; 8 // First, try to retrieve value from previous resVals, otherwise build it from chunk
9 if (varName != "self")
10 {
11 + //
12 + // XXX Note: Here, we may encounter some issues if the chunk's type_map isnt properly filled
13 + // (encountered once, the type was scalar instead of ref)
14 + //
15 + local self_reftype = "scalar";
16 + local self_rtype;
17 if (rtxNodeArgs_GetArgByName(resolverValues, varName, self) == true)
18 {
19 rtxNodeArg_getValue(self, self_value);
20 + rtxNodeArg_getRType(self, self_rtype);
21 + self_reftype = self_rtype.qualifier;
22 }
23 else
24 {
25 @@ -740,8 +748,10 @@
26 clearVariable(self_value);
27 cnormNode_TerminalId(self_value, varName);
28 }
29 - rtxNodeArgs_AppendArg(resVal, "self", theChunk.type_map[varName], self_value);
30 - setall self_type = theChunk.type_map[varName];
31 + setall self_rtype = theChunk.type_map[varName];
32 + self_rtype.qualifier = self_reftype;
33 + rtxNodeArgs_AppendArg(resVal, "self", self_rtype, self_value);
34 + setall self_type = self_rtype;
8 } 35 }
9 36 else
10 + if (coreString(local_node#parent.location,0,2) == "/home/kal/projs/rathaxes/rathaxes/samples/e1000/e1000.blt:971:")
11 + {
12 + traceLine(BLUE + toString(mapping,true) + DEFAULT_COLOR);
13 + }
14 +
15 if (isString(mapping))
16 { 37 {
17 local_node#parent.ref_placeholder.id = mapping;
18 @@ -812,9 +817,18 @@
19 }
20 local in_type = source_type.qualifier;
21 local out_type = local_node#parent.ph_type;
22 + traceLine("paf: " + local_node#parent.location);
23 + if (local_node#parent.location == "/home/kal/projs/rathaxes/rathaxes/samples/e1000/ethernet.blt:124:40")
24 + {
25 + traceLine(YELLOW + "in_type = " + in_type+ DEFAULT_COLOR);
26 + traceLine(YELLOW + "out_type = " + out_type+ DEFAULT_COLOR);
27 + traceLine(CYAN + toString(resolverValues,true) + DEFAULT_COLOR);
28 + }
29 if (rtxResolve_RefScalarTranscribe(mapping, in_type, out_type) == false)
30 { error(RED + "[Error] Cannot transcribe an expression from " + in_type + " to " + out_type + DEFAULT_COLOR); }
31 setall local_node#parent.ref_placeholder = mapping;
32 + if (coreString(local_node#parent.location,0,2) == "/home/kal/projs/rathaxes/rathaxes/samples/e1000/e1000.blt:971:")
33 + exit(1);
34 }
35 }
36 else if (isBuiltinVariable(varName)) // Mapping for a builtin type
37 @@ -1445,6 +1459,12 @@
38 }
39 rtxNodeArg_getValue(self, val);
40 setall out_node = val;
41 + if (placeHolder#parent.location == "/home/kal/projs/rathaxes/rathaxes/samples/e1000/ethernet.blt:124:40")
42 + {
43 + traceLine(PURPLE + toString(val,true)+ DEFAULT_COLOR);
44 + //error("toto");
45 + //exit(1);
46 + }
47 }
48
49 return true;