Java: Add expanded arguments

This commit is contained in:
Ian Lynagh
2023-03-22 15:44:07 +00:00
parent b382465078
commit 81a26f0396
2 changed files with 23 additions and 0 deletions

View File

@@ -60,6 +60,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
);
/**
* The source files that are compiled by a compiler invocation.
* If `id` is for the compiler invocation

View File

@@ -83,6 +83,16 @@ 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 = getExpandedArgument(_) }
/**
* Gets the `i`th expanded argument passed to the extractor on this invocation.
*/
string getExpandedArgument(int i) { compilation_expanded_args(this, i, result) }
/**
* Gets the total amount of CPU time spent processing all the files in the
* compiler.