Merge pull request #20831 from jketema/expanded

C++: Extract the expanded compiler arguments
This commit is contained in:
Jeroen Ketema
2025-11-17 13:58:24 +01:00
committed by GitHub
10 changed files with 13002 additions and 2675 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
description: Support expanded compilation argument lists
compatibility: full
compilation_expanded_args.rel: delete

View File

@@ -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.

View File

@@ -94,6 +94,21 @@ class Compilation extends @compilation {
*/ */
string getArgument(int i) { compilation_args(this, i, result) } 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 * Gets the total amount of CPU time spent processing all the files in the
* front-end and extractor. * front-end and extractor.

View File

@@ -47,6 +47,19 @@ compilation_args(
string arg : string ref 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. * Optionally, record the build mode for each compilation.
*/ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Support expanded compilation argument lists
compatibility: backwards