CPP: Optimize AV Rule 35's usesMacro.

This commit is contained in:
Geoffrey White
2019-03-07 17:28:31 +00:00
parent 4075f570e2
commit 7fd08233c3

View File

@@ -88,6 +88,7 @@ string extraDetail(HeaderFile hf, SomePreprocessorDirective detail1, SomePreproc
* Header file `hf` uses a macro called `macroName`.
*/
predicate usesMacro(HeaderFile hf, string macroName) {
not hf instanceof IncludeGuardedHeader and // restrict to cases the query looks at
exists(MacroAccess ma |
ma.getFile() = hf and
ma.getMacro().getName() = macroName