@@ -81,8 +81,8 @@ predicate functionContainsPreprocCode(Function f) {
81
81
}
82
82
83
83
/**
84
- * Holds if `e` is completely or partially from a macro invocation `mi` , as
85
- * opposed to being passed in as an argument.
84
+ * Holds if `e` is completely or partially from a macro definition , as opposed
85
+ * to being passed in as an argument.
86
86
*
87
87
* In the following example, the call to `f` is from a macro definition,
88
88
* while `y`, `+`, `1`, and `;` are not. This assumes that no identifier apart
@@ -93,8 +93,8 @@ predicate functionContainsPreprocCode(Function f) {
93
93
* M(y + 1);
94
94
* ```
95
95
*/
96
- private predicate isFromMacroInvocation ( Element e , MacroInvocation mi ) {
97
- exists ( Location eLocation , Location miLocation |
96
+ predicate isFromMacroDefinition ( Element e ) {
97
+ exists ( MacroInvocation mi , Location eLocation , Location miLocation |
98
98
mi .getAnExpandedElement ( ) = e and
99
99
eLocation = e .getLocation ( ) and
100
100
miLocation = mi .getLocation ( ) and
@@ -109,39 +109,3 @@ private predicate isFromMacroInvocation(Element e, MacroInvocation mi) {
109
109
eLocation .getEndColumn ( ) >= miLocation .getEndColumn ( )
110
110
)
111
111
}
112
-
113
- /**
114
- * Holds if `e` is completely or partially from a macro definition, as opposed
115
- * to being passed in as an argument.
116
- *
117
- * In the following example, the call to `f` is from a macro definition,
118
- * while `y`, `+`, `1`, and `;` are not. This assumes that no identifier apart
119
- * from `M` refers to a macro.
120
- * ```
121
- * #define M(x) f(x)
122
- * ...
123
- * M(y + 1);
124
- * ```
125
- */
126
- predicate isFromMacroDefinition ( Element e ) {
127
- isFromMacroInvocation ( e , _)
128
- }
129
-
130
- /**
131
- * Holds if `e` is completely or partially from a _system macro_ definition, as
132
- * opposed to being passed in as an argument. A system macro is a macro whose
133
- * definition is outside the source directory of the database.
134
- *
135
- * If the system macro is invoked through a non-system macro, then this
136
- * predicate does not hold. That's a limitation of how macros are represented
137
- * in the database.
138
- *
139
- * See also `isFromMacroDefinition`.
140
- */
141
- predicate isFromSystemMacroDefinition ( Element e ) {
142
- exists ( MacroInvocation mi |
143
- isFromMacroInvocation ( e , mi ) and
144
- // Has no relative path in the database, meaning it's a system file.
145
- not exists ( mi .getMacro ( ) .getFile ( ) .getRelativePath ( ) )
146
- )
147
- }
0 commit comments