@@ -17,18 +17,25 @@ module MacroUnwrapper<ResultType ResultElement> {
17
17
result .getAnAffectedElement ( ) = re
18
18
}
19
19
20
+ private MacroInvocation getASubsumedMacroInvocation ( ResultElement re ) {
21
+ result = getAMacroInvocation ( re ) and
22
+ // Only report cases where the element is not located at the macro expansion site
23
+ // This means we'll report results in macro arguments in the macro argument
24
+ // location, not within the macro itself.
25
+ //
26
+ // Do not join start column values.
27
+ pragma [ only_bind_out ] ( result .getLocation ( ) .getStartColumn ( ) ) =
28
+ pragma [ only_bind_out ] ( re .getLocation ( ) .getStartColumn ( ) )
29
+ }
30
+
20
31
/**
21
32
* Gets the primary macro invocation that generated the result element.
22
33
*
23
34
* Does not hold for cases where the result element is located at a macro argument site.
24
35
*/
25
36
MacroInvocation getPrimaryMacroInvocation ( ResultElement re ) {
26
37
exists ( MacroInvocation mi |
27
- mi = getAMacroInvocation ( re ) and
28
- // Only report cases where the element is not located at the macro expansion site
29
- // This means we'll report results in macro arguments in the macro argument
30
- // location, not within the macro itself
31
- mi .getLocation ( ) .getStartColumn ( ) = re .getLocation ( ) .getStartColumn ( ) and
38
+ mi = getASubsumedMacroInvocation ( re ) and
32
39
// No other more specific macro that expands to element
33
40
not exists ( MacroInvocation otherMi |
34
41
otherMi = getAMacroInvocation ( re ) and otherMi .getParentInvocation ( ) = mi
0 commit comments