annotate rathaxes_compiler_passes_correctly_resolve_all_variables_subidentifiers.patch @ 122:52402232483f

WIP on the split up of e1000::set_up_device
author Louis Opter <louis@lse.epita.fr>
date Sun, 28 Jul 2013 02:50:43 -0700
parents b22983cb9e3a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
113
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
1 # HG changeset patch
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
2 # User David Pineau <dav.pineau@gmail.com>, Louis Opter <louis@lse.epita.fr>
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
3 # Parent 0f12e80e810de1a9927db1f25dbea49acd73ae3c
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
4 rathxes: correctly resolve all variable subidentifier
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
5
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
6 For example, for a variable like "local.sk_buff.k_dma_handle" type
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
7 introspection won't stop at "local.sk_buff" anymore but go all the way
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
8 down "local.sk_buff.k_dma_handle" which means that the expression will
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
9 yield the correct type.
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
10
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
11 diff --git a/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws b/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
12 --- a/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
13 +++ b/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
14 @@ -752,7 +752,28 @@
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
15 if (findElement(theVar.name, theChunk.type_map))
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
16 ref theType = theChunk.type_map[theVar.name];
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
17 insert param.rtype;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
18 - setall param.rtype = theType;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
19 + if (getArraySize(param.identifiers) > 2)
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
20 + {
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
21 + local subType;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
22 + local fieldList;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
23 + foreach field in param.identifiers
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
24 + {
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
25 + pushItem fieldList;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
26 + fieldList#back = field.name;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
27 + }
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
28 + removeFirstElement(fieldList);
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
29 + removeFirstElement(fieldList);
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
30 + if (rtxTypingLookup_ResolveTypeFields(theType, fieldList, theChunk, theChunk#root /* XXX dummy */, subType) == false)
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
31 + {
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
32 + error(RED + "[Error] Could not resolve type fields for variable '"
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
33 + + theVar + "'" + DEFAULT_COLOR);
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
34 + }
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
35 + setall param.rtype = subType;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
36 + }
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
37 + else
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
38 + {
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
39 + setall param.rtype = theType;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
40 + }
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
41 }
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
42 pushItem params;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
43 setall params#back = param.rtype.name;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
44 diff --git a/rathaxes/compiler/passes/common/rtxResolve.inc.cws b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
45 --- a/rathaxes/compiler/passes/common/rtxResolve.inc.cws
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
46 +++ b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
47 @@ -887,7 +887,7 @@
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
48 local phName = "_"+local_node#parent.block_idx;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
49 local phIdx = 0;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
50 localref theParent = local_node#parent.ref_placeholder#parent;
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
51 - if (local_node#parent.type_target != "target_pointcut")
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
52 + if (local_node#parent.type_target != "target_pointcut" && local_node#parent.type_target != "target_expr")
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
53 {
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
54 error(RED + "[Error] inject<\"__rtx_tpl_sequence_call__\">: Wrong target type ("
b22983cb9e3a WIP, thanks joa for some fixes on the compiler
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
55 + local_node#parent.type_target + ")" + DEFAULT_COLOR);