1414
1515import cpp
1616
17- predicate emptyBlock ( ControlStructure s , Block b ) {
17+ predicate emptyBlock ( ControlStructure s , BlockStmt b ) {
1818 b = s .getAChild ( ) and
1919 not exists ( b .getAChild ( ) ) and
2020 not b .isInMacroExpansion ( ) and
@@ -23,7 +23,7 @@ predicate emptyBlock(ControlStructure s, Block b) {
2323
2424class AffectedFile extends File {
2525 AffectedFile ( ) {
26- exists ( Block b |
26+ exists ( BlockStmt b |
2727 emptyBlock ( _, b ) and
2828 this = b .getFile ( )
2929 )
@@ -37,7 +37,7 @@ class AffectedFile extends File {
3737class BlockOrNonChild extends Element {
3838 BlockOrNonChild ( ) {
3939 (
40- this instanceof Block
40+ this instanceof BlockStmt
4141 or
4242 this instanceof Comment
4343 or
@@ -78,7 +78,7 @@ class BlockOrNonChild extends Element {
7878/**
7979 * A block that contains a non-child element.
8080 */
81- predicate emptyBlockContainsNonchild ( Block b ) {
81+ predicate emptyBlockContainsNonchild ( BlockStmt b ) {
8282 emptyBlock ( _, b ) and
8383 exists ( BlockOrNonChild c , AffectedFile file |
8484 c .( BlockOrNonChild ) .getStartRankIn ( file ) = 1 + b .( BlockOrNonChild ) .getStartRankIn ( file ) and
@@ -91,7 +91,7 @@ predicate emptyBlockContainsNonchild(Block b) {
9191 * A block that is entirely on one line, which also contains a comment. Chances
9292 * are the comment is intended to refer to the block.
9393 */
94- predicate lineComment ( Block b ) {
94+ predicate lineComment ( BlockStmt b ) {
9595 emptyBlock ( _, b ) and
9696 exists ( Location bLocation , File f , int line |
9797 bLocation = b .getLocation ( ) and
@@ -106,7 +106,7 @@ predicate lineComment(Block b) {
106106 )
107107}
108108
109- from ControlStructure s , Block eb
109+ from ControlStructure s , BlockStmt eb
110110where
111111 emptyBlock ( s , eb ) and
112112 not emptyBlockContainsNonchild ( eb ) and
0 commit comments