Skip to content

Commit 81a26f0

Browse files
committed
Java: Add expanded arguments
1 parent b382465 commit 81a26f0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

java/ql/lib/config/semmlecode.dbscheme

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ compilation_args(
6060
string arg : string ref
6161
);
6262

63+
/**
64+
* The expanded arguments that were passed to the extractor for a
65+
* compiler invocation. This is similar to `compilation_args`, but
66+
* for a `@@@someFile` argument, it includes the arguments from that
67+
* file, rather than just taking the argument literally.
68+
*/
69+
#keyset[id, num]
70+
compilation_expanded_args(
71+
int id : @compilation ref,
72+
int num : int ref,
73+
string arg : string ref
74+
);
75+
6376
/**
6477
* The source files that are compiled by a compiler invocation.
6578
* If `id` is for the compiler invocation

java/ql/lib/semmle/code/java/Compilation.qll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ class Compilation extends @compilation {
8383
*/
8484
string getArgument(int i) { compilation_args(this, i, result) }
8585

86+
/**
87+
* Gets an expanded argument passed to the extractor on this invocation.
88+
*/
89+
string getAnExpandedArgument() { result = getExpandedArgument(_) }
90+
91+
/**
92+
* Gets the `i`th expanded argument passed to the extractor on this invocation.
93+
*/
94+
string getExpandedArgument(int i) { compilation_expanded_args(this, i, result) }
95+
8696
/**
8797
* Gets the total amount of CPU time spent processing all the files in the
8898
* compiler.

0 commit comments

Comments
 (0)