C++: Put QLDoc on two helper predicates

This commit is contained in:
Jonas Jensen
2019-01-11 14:07:22 +01:00
parent b38ca944f4
commit b65e2f8b79

View File

@@ -11,13 +11,14 @@
import cpp
// Names of parameters in the implementation of a function.
// Notice that we need to exclude parameter names used in prototype
// declarations and only include the ones from the actual definition.
// We also exclude names from functions that have multiple definitions.
// This should not happen in a single application but since we
// have a system wide view it is likely to happen for instance for
// the main function.
/**
* Gets the parameter of `f` with name `name`, which has to come from the
* _definition_ of `f` and not a prototype declaration.
* We also exclude names from functions that have multiple definitions.
* This should not happen in a single application but since we
* have a system wide view it is likely to happen for instance for
* the main function.
*/
ParameterDeclarationEntry functionParameterNames(Function f, string name) {
exists(FunctionDeclarationEntry fe |
result.getFunctionDeclarationEntry() = fe and
@@ -29,6 +30,7 @@ ParameterDeclarationEntry functionParameterNames(Function f, string name) {
)
}
/** Gets a local variable in `f` with name `name`. */
pragma[nomagic]
LocalVariable localVariableNames(Function f, string name) {
name = result.getName() and