@@ -107,15 +107,17 @@ predicate defUndef(File f, string macroName) {
107107}
108108
109109/**
110- * Header file `hf` looks like it contains an x-macro called
111- * `macroName`. That is, a macro that is used to interpret the
110+ * Header file `hf` looks like it contains an x-macro.
111+ * That is, a macro that is used to interpret the
112112 * data in `hf`, usually defined just before including that file
113113 * and undefined immediately afterwards.
114114 */
115- predicate hasXMacro ( HeaderFile hf , string macroName ) {
116- usesMacro ( hf , macroName ) and
117- forex ( Include i | i .getIncludedFile ( ) = hf |
118- defUndef ( i .getFile ( ) , macroName )
115+ predicate hasXMacro ( HeaderFile hf ) {
116+ exists ( string macroName |
117+ usesMacro ( hf , macroName ) and
118+ forex ( File f | f .getAnIncludedFile ( ) = hf |
119+ defUndef ( f , macroName )
120+ )
119121 )
120122}
121123
@@ -135,7 +137,7 @@ where not hf instanceof IncludeGuardedHeader
135137 exists ( UsingEntry ue | ue .getFile ( ) = hf )
136138 )
137139 // Exclude files which look like they contain 'x-macros'
138- and not hasXMacro ( hf , _ )
140+ and not hasXMacro ( hf )
139141 // Exclude files which are always #imported.
140142 and not forex ( Include i | i .getIncludedFile ( ) = hf | i instanceof Import )
141143 // Exclude files which are only included once.
0 commit comments