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,525 changes: 2,525 additions & 0 deletions cpp/downgrades/40e7e591693a6f63fb4c32f12e1c5b2456c6f174/old.dbscheme

Large diffs are not rendered by default.

2,517 changes: 2,517 additions & 0 deletions cpp/downgrades/40e7e591693a6f63fb4c32f12e1c5b2456c6f174/semmlecode.dbscheme

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Trap extends @trap {
string toString() { none() }
}

from string source_file, Trap trap
where none()
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this query actually do anything? none() looks odd here, and source_file is never bound.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's worth trying to make the upgrade/downgrade scripts do anything useful for overlays across this change. Overlays aren't supported on one side of the boundary anyway.

I think we need to explicitly make empty tables with the right types in order to achieve that, though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why would it be non-functional? This just seems a re-arrangement of tables for efficiency reasons.

Copy link
Member Author

Choose a reason for hiding this comment

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

We haven't finished implementing overlay support yet. I don't think it's worth thinking about upgrading the contents of the overlay tables to or from a time when overlay isn't complete. I can make the scripts populate the tables if you disagree, though.

select source_file, trap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
description: Add source_file_name
compatibility: backwards
source_file_uses_trap.rel: run source_file_uses_trap.qlo
source_file_name.rel: delete
10 changes: 9 additions & 1 deletion cpp/ql/lib/semmlecode.cpp.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,22 @@ trap_filename(
string filename: string ref
);

/**
* Gives the name for the source file.
*/
source_file_name(
int sf: @source_file,
string name: string ref
);

/**
* 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 source_file: @source_file ref,
int trap_file: @trap ref
);

Expand Down
Loading
Loading