mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
25 lines
649 B
Plaintext
25 lines
649 B
Plaintext
private import cpp
|
|
|
|
/**
|
|
* Holds if the specified location is in standard headers.
|
|
*/
|
|
predicate locationIsInStandardHeaders(Location loc) {
|
|
loc.getFile().getAbsolutePath().regexpMatch(".*/include/[^/]+")
|
|
}
|
|
|
|
/**
|
|
* Holds if the AST or IR for the specified declaration should be printed in the test output.
|
|
*
|
|
* This predicate excludes declarations defined in standard headers.
|
|
*/
|
|
predicate shouldDumpDeclaration(Declaration decl) {
|
|
not locationIsInStandardHeaders(decl.getLocation()) and
|
|
(
|
|
decl instanceof Function
|
|
or
|
|
decl.(GlobalOrNamespaceVariable).hasInitializer()
|
|
or
|
|
decl.(StaticLocalVariable).hasInitializer()
|
|
)
|
|
}
|