File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed
cpp/ql/test/library-tests/ir/ir Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,11 @@ predicate locationIsInStandardHeaders(Location loc) {
12
12
*
13
13
* This predicate excludes functions defined in standard headers.
14
14
*/
15
- predicate shouldDumpFunction ( Function func ) { not locationIsInStandardHeaders ( func .getLocation ( ) ) }
15
+ predicate shouldDumpFunction ( Declaration decl ) {
16
+ not locationIsInStandardHeaders ( decl .getLocation ( ) ) and
17
+ (
18
+ not decl instanceof Variable
19
+ or
20
+ decl .( GlobalOrNamespaceVariable ) .hasInitializer ( )
21
+ )
22
+ }
Original file line number Diff line number Diff line change @@ -139,8 +139,6 @@ bad_asts.cpp:
139
139
# 30| v30_6(void) = ExitFunction :
140
140
141
141
clang.cpp:
142
- # 3| int globalInt
143
-
144
142
# 5| int* globalIntAddress()
145
143
# 5| Block 0
146
144
# 5| v5_1(void) = EnterFunction :
@@ -2226,8 +2224,6 @@ ir.cpp:
2226
2224
# 341| v341_11(void) = AliasedUse : ~m?
2227
2225
# 341| v341_12(void) = ExitFunction :
2228
2226
2229
- # 346| int g
2230
-
2231
2227
# 348| int* AddressOf()
2232
2228
# 348| Block 0
2233
2229
# 348| v348_1(void) = EnterFunction :
@@ -9016,8 +9012,6 @@ ir.cpp:
9016
9012
# 1693| v1693_6(void) = AliasedUse : ~m?
9017
9013
# 1693| v1693_7(void) = ExitFunction :
9018
9014
9019
- # 1699| int global_1
9020
-
9021
9015
# 1701| int global_2
9022
9016
# 1701| Block 0
9023
9017
# 1701| v1701_1(void) = EnterFunction :
@@ -9330,8 +9324,6 @@ struct_init.cpp:
9330
9324
# 9| v9_9(void) = AliasedUse : ~m?
9331
9325
# 9| v9_10(void) = ExitFunction :
9332
9326
9333
- # 14| Info* global_pointer
9334
-
9335
9327
# 16| void let_info_escape(Info*)
9336
9328
# 16| Block 0
9337
9329
# 16| v16_1(void) = EnterFunction :
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ private import PrintConfig
8
8
9
9
private class PrintConfig extends PrintIRConfiguration {
10
10
override predicate shouldPrintFunction ( Declaration decl ) {
11
- shouldDumpFunction ( decl ) or decl instanceof GlobalOrNamespaceVariable
11
+ shouldDumpFunction ( decl )
12
12
}
13
13
}
You can’t perform that action at this time.
0 commit comments