Skip to content

Commit

Permalink
component_tags -> struct_tags
Browse files Browse the repository at this point in the history
  • Loading branch information
smowton committed Oct 8, 2024
1 parent c1a1edf commit 288e0ec
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ underlying_type(unique int named: @namedtype ref, int tp: @type ref);
component_types(int parent: @compositetype ref, int index: int ref, string name: string ref, int tp: @type ref);

#keyset[parent, index]
component_tags(int parent: @structtype ref, int index: int ref, string tag: string ref);
struct_tags(int parent: @structtype ref, int index: int ref, string tag: string ref);

#keyset[interface, index]
interface_private_method_ids(int interface: @interfacetype ref, int index: int ref, string id: string ref);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description: Remove component-tags and interface-method-id tables
compatibility: full

component_tags.rel: delete
struct_tags.rel: delete
interface_private_method_ids.rel: delete
4 changes: 2 additions & 2 deletions go/extractor/dbscheme/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,8 @@ var ComponentTypesTable = NewTable("component_types",
EntityColumn(TypeType, "tp"),
).KeySet("parent", "index")

// ComponentTagsTable is the table associating struct types with their component types' tags
var ComponentTagsTable = NewTable("component_tags",
// StructTagsTable is the table associating struct types with their component types' tags
var StructTagsTable = NewTable("struct_tags",
EntityColumn(StructType, "parent"),
IntColumn("index"),
StringColumn("tag"),
Expand Down
2 changes: 1 addition & 1 deletion go/extractor/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label {
}
extractComponentType(tw, lbl, i, name, field.Type())
if tp.Tag(i) != "" {
dbscheme.ComponentTagsTable.Emit(tw, lbl, i, tp.Tag(i))
dbscheme.StructTagsTable.Emit(tw, lbl, i, tp.Tag(i))
}
}
case *types.Pointer:
Expand Down
2 changes: 1 addition & 1 deletion go/ql/lib/go.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ underlying_type(unique int named: @namedtype ref, int tp: @type ref);
component_types(int parent: @compositetype ref, int index: int ref, string name: string ref, int tp: @type ref);

#keyset[parent, index]
component_tags(int parent: @structtype ref, int index: int ref, string tag: string ref);
struct_tags(int parent: @structtype ref, int index: int ref, string tag: string ref);

#keyset[interface, index]
interface_private_method_ids(int interface: @interfacetype ref, int index: int ref, string id: string ref);
Expand Down
2 changes: 1 addition & 1 deletion go/ql/lib/go.dbscheme.stats
Original file line number Diff line number Diff line change
Expand Up @@ -13979,7 +13979,7 @@
</dependencies>
</relation>
<relation>
<name>component_tags</name>
<name>struct_tags</name>
<cardinality>41038845</cardinality>
<columnsizes>
<e>
Expand Down
8 changes: 4 additions & 4 deletions go/ql/lib/semmle/go/Types.qll
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ class StructType extends @structtype, CompositeType {
predicate hasOwnFieldWithTag(int i, string name, Type tp, boolean isEmbedded, string tag) {
this.hasOwnField(i, name, tp, isEmbedded) and
(
component_tags(this, i, tag)
struct_tags(this, i, tag)
or
not component_tags(this, i, _) and tag = ""
not struct_tags(this, i, _) and tag = ""
)
}

Expand Down Expand Up @@ -594,9 +594,9 @@ class StructType extends @structtype, CompositeType {
concat(int i, string name, Type tp, string tagToPrint |
component_types(this, i, name, tp) and
(
tagToPrint = " `" + any(string tag | component_tags(this, i, tag)) + "`"
tagToPrint = " `" + any(string tag | struct_tags(this, i, tag)) + "`"
or
tagToPrint = "" and not component_tags(this, i, _)
tagToPrint = "" and not struct_tags(this, i, _)
)
|
name + " " + tp.pp() + tagToPrint, "; " order by i
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ underlying_type(unique int named: @namedtype ref, int tp: @type ref);
component_types(int parent: @compositetype ref, int index: int ref, string name: string ref, int tp: @type ref);

#keyset[parent, index]
component_tags(int parent: @structtype ref, int index: int ref, string tag: string ref);
struct_tags(int parent: @structtype ref, int index: int ref, string tag: string ref);

#keyset[interface, index]
interface_private_method_ids(int interface: @interfacetype ref, int index: int ref, string id: string ref);
Expand Down

0 comments on commit 288e0ec

Please sign in to comment.