From ee97d6f46189b21fb81d12f0bebdc20b5ef22e02 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 12 Nov 2025 11:47:29 +0100 Subject: [PATCH] C++: Expose the expanded compilation arguments --- cpp/ql/lib/semmle/code/cpp/Compilation.qll | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/Compilation.qll b/cpp/ql/lib/semmle/code/cpp/Compilation.qll index 407dc31e05f..716156acb44 100644 --- a/cpp/ql/lib/semmle/code/cpp/Compilation.qll +++ b/cpp/ql/lib/semmle/code/cpp/Compilation.qll @@ -94,6 +94,19 @@ 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(_) } + + /** + * The expanded arguments that were passed to the extractor for a + * compiler 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.