Skip to content

Commit a253062

Browse files
committed
representation_specifications: fix regression on VC09-038
by taking advantage of the new inherited field of p_get_aspect TN: W214-017 Change-Id: I2e5f45c3fc4095b704d50f38b3e6bb9ef6c8aa9a
1 parent 7d5220f commit a253062

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

lkql_checker/share/lkql/representation_specifications.lkql

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,31 @@ selector defining_names
1111
| BasicDecl => *(this.p_defining_names())
1212
| * => ()
1313

14+
fun has_aspect(node, aspect) = {
15+
val a = node.p_get_aspect(aspect);
16+
a.exists and not a.inherited
17+
}
18+
1419
fun has_rep_aspect(node) =
15-
node.p_has_aspect("Address") or
16-
node.p_has_aspect("Alignment") or
17-
node.p_has_aspect("Size") or
18-
node.p_has_aspect("Component_Size") or
19-
node.p_has_aspect("External_Tag") or
20-
node.p_has_aspect("Asynchronous") or
21-
node.p_has_aspect("Convention") or
22-
node.p_has_aspect("Import") or
23-
node.p_has_aspect("Export") or
24-
node.p_has_aspect("No_Return") or
25-
node.p_has_aspect("Atomic") or
26-
node.p_has_aspect("Atomic_Components") or
27-
node.p_has_aspect("Discard_Names") or
28-
node.p_has_aspect("Independent") or
29-
node.p_has_aspect("Independent_Components") or
30-
node.p_has_aspect("Pack") or
31-
node.p_has_aspect("Unchecked_Union") or
32-
node.p_has_aspect("Volatile") or
33-
node.p_has_aspect("Volatile_Components")
20+
has_aspect(node, "Address") or
21+
has_aspect(node, "Alignment") or
22+
has_aspect(node, "Size") or
23+
has_aspect(node, "Component_Size") or
24+
has_aspect(node, "External_Tag") or
25+
has_aspect(node, "Asynchronous") or
26+
has_aspect(node, "Convention") or
27+
has_aspect(node, "Import") or
28+
has_aspect(node, "Export") or
29+
has_aspect(node, "No_Return") or
30+
has_aspect(node, "Atomic") or
31+
has_aspect(node, "Atomic_Components") or
32+
has_aspect(node, "Discard_Names") or
33+
has_aspect(node, "Independent") or
34+
has_aspect(node, "Independent_Components") or
35+
has_aspect(node, "Pack") or
36+
has_aspect(node, "Unchecked_Union") or
37+
has_aspect(node, "Volatile") or
38+
has_aspect(node, "Volatile_Components")
3439

3540
@unit_check(help="representation specification", category="Feature")
3641
fun representation_specifications(unit, record_rep_clauses_only=false) = [

0 commit comments

Comments
 (0)