Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,517 changes: 2,517 additions & 0 deletions cpp/downgrades/7e7c2f55670f8123d514cf542ccb1938118ac561/old.dbscheme

Large diffs are not rendered by default.

2,489 changes: 2,489 additions & 0 deletions cpp/downgrades/7e7c2f55670f8123d514cf542ccb1938118ac561/semmlecode.dbscheme

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Add trap_filename, source_file_uses_trap and in_trap relations
compatibility: full
trap_filename.rel: delete
source_file_uses_trap.rel: delete
in_trap.rel: delete
28 changes: 28 additions & 0 deletions cpp/ql/lib/semmlecode.cpp.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,34 @@ extractor_version(
string frontend_version: string ref
)

/**
* Gives the TRAP filename that `trap` is associated with.
* For debugging only.
*/
trap_filename(
int trap: @trap,
string filename: string ref
);
Comment on lines +243 to +246
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type @trap is used in the new relations but is never defined in the schema. Database schema types must be defined before they can be referenced. You should add a definition for @trap, similar to how @pch, @compilation, and other types are defined. This could be either a primitive type definition or a union type definition depending on what @trap represents.

Copilot uses AI. Check for mistakes.
Comment on lines +243 to +246
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trap_filename relation lacks a keyset declaration. Consider adding #keyset[trap] or unique int trap: @trap constraint to clarify the primary key and ensure data integrity. Looking at similar relations in the schema (e.g., pch_uses at line 267), relations typically have explicit key constraints defined.

This issue also appears in the following locations of the same file:

  • line 254
  • line 262

Copilot uses AI. Check for mistakes.

/**
* In `build-mode: none` overlay mode, indicates that `source_file`
* (`/path/to/foo.c`) uses the TRAP file `trap_file`; i.e. it is the
* TRAP file corresponding to `foo.c`, something it transitively
* includes, or a template instantiation it transitively uses.
*/
source_file_uses_trap(
string source_file: string ref,
int trap_file: @trap ref
);

/**
* Holds if there is a definition of `element` in TRAP file `trap_file`.
*/
in_trap(
int element: @element ref,
int trap_file: @trap ref
);

pch_uses(
int pch: @pch ref,
int compilation: @compilation ref,
Expand Down
Loading
Loading