Skip to content
Merged
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,450 changes: 2,450 additions & 0 deletions cpp/downgrades/1a6854060d5d3ada16c580a29f8c5ce21f3367f8/old.dbscheme

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: Support expanded compilation argument lists
compatibility: full
compilation_expanded_args.rel: delete
4 changes: 4 additions & 0 deletions cpp/ql/lib/change-notes/2025-11-13-expanded.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: feature
---
* New predicates `getAnExpandedArgument` and `getExpandedArgument` were added to the `Compilation` class, yielding compilation arguments after expansion of response files.
15 changes: 15 additions & 0 deletions cpp/ql/lib/semmle/code/cpp/Compilation.qll
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ class Compilation extends @compilation {
*/
string getArgument(int i) { compilation_args(this, i, result) }

/**
* Gets an expanded argument passed to the extractor on this invocation.
*/
string getAnExpandedArgument() { result = this.getArgument(_) }

/**
* Gets the `i`th expanded argument passed to the extractor on this
* invocation.
*
* This is similar to `getArgument`, but for a `@someFile` argument, it
* includes the arguments from that file, rather than just taking the
* argument literally.
*/
string getExpandedArgument(int i) { compilation_expanded_args(this, i, result) }

/**
* Gets the total amount of CPU time spent processing all the files in the
* front-end and extractor.
Expand Down
13 changes: 13 additions & 0 deletions cpp/ql/lib/semmlecode.cpp.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ compilation_args(
string arg : string ref
);

/**
* The expanded arguments that were passed to the extractor for a
* compiler invocation. This is similar to `compilation_args`, but
* for a `@someFile` argument, it includes the arguments from that
* file, rather than just taking the argument literally.
*/
#keyset[id, num]
compilation_expanded_args(
int id : @compilation ref,
int num : int ref,
string arg : string ref
);

/**
* Optionally, record the build mode for each compilation.
*/
Expand Down
Loading